home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 10 / BBS In A Box Volume X (AMUG) (January 1994).bin / Files / Prog / U-Z / VideoToolBox.cpt / VideoToolboxSources / GDVideo.c < prev    next >
MacBinary  |  1993-03-18  |  46.5 KB  |  [TEXT/KAHL]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
66% dexvert Compact Compressed (Unix) (archive/compact) ext Supported
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Thu Mar 18 18:55:03 1993, modified Thu Mar 18 18:55:03 1993, creator Think C, type ASCII, 46632 bytes "GDVideo.c" , at 0xb6a8 760 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[KAHL]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 09 47 44 56 69 64 65 | 6f 2e 63 00 00 00 00 00 |..GDVide|o.c.....|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4b 41 48 | 4c 01 00 00 00 00 00 00 |.TEXTKAH|L.......|
|00000050| 00 00 00 00 00 b6 28 00 | 00 02 f8 a7 ce bc 57 a7 |......(.|......W.|
|00000060| ce bc 57 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |..W.....|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 31 38 00 00 |........|....18..|
|00000080| 2f 2a 20 0d 47 44 56 69 | 64 65 6f 2e 63 0d 43 6f |/* .GDVi|deo.c.Co|
|00000090| 70 79 72 69 67 68 74 20 | a9 20 31 39 38 39 2d 31 |pyright |. 1989-1|
|000000a0| 39 39 33 20 44 65 6e 69 | 73 20 47 2e 20 50 65 6c |993 Deni|s G. Pel|
|000000b0| 6c 69 0d 0d 43 6f 6d 70 | 6c 65 74 65 20 73 65 74 |li..Comp|lete set|
|000000c0| 20 6f 66 20 72 6f 75 74 | 69 6e 65 73 20 74 6f 20 | of rout|ines to |
|000000d0| 63 6f 6e 74 72 6f 6c 20 | 76 69 64 65 6f 20 64 72 |control |video dr|
|000000e0| 69 76 65 72 73 20 64 69 | 72 65 63 74 6c 79 2c 20 |ivers di|rectly, |
|000000f0| 62 79 70 61 73 73 69 6e | 67 0d 51 75 69 63 6b 44 |bypassin|g.QuickD|
|00000100| 72 61 77 27 73 20 43 6f | 6c 6f 72 20 61 6e 64 20 |raw's Co|lor and |
|00000110| 50 61 6c 65 74 74 65 20 | 4d 61 6e 61 67 65 72 73 |Palette |Managers|
|00000120| 2e 20 54 68 65 72 65 20 | 69 73 20 61 20 73 65 70 |. There |is a sep|
|00000130| 61 72 61 74 65 20 66 75 | 6e 63 74 69 6f 6e 20 63 |arate fu|nction c|
|00000140| 61 6c 6c 20 66 6f 72 0d | 65 61 63 68 20 6f 66 20 |all for.|each of |
|00000150| 74 68 65 20 43 6f 6e 74 | 72 6f 6c 20 61 6e 64 20 |the Cont|rol and |
|00000160| 53 74 61 74 75 73 20 63 | 61 6c 6c 73 20 69 6d 70 |Status c|alls imp|
|00000170| 6c 65 6d 65 6e 74 65 64 | 20 62 79 20 76 69 64 65 |lemented| by vide|
|00000180| 6f 20 64 72 69 76 65 72 | 73 2e 20 54 68 65 79 20 |o driver|s. They |
|00000190| 61 72 65 0d 64 65 73 63 | 72 69 62 65 64 20 69 6e |are.desc|ribed in|
|000001a0| 20 44 65 73 69 67 6e 69 | 6e 67 20 43 61 72 64 73 | Designi|ng Cards|
|000001b0| 20 61 6e 64 20 44 72 69 | 76 65 72 73 2c 20 33 72 | and Dri|vers, 3r|
|000001c0| 64 20 45 64 2e 2c 20 63 | 68 61 70 74 65 72 20 39 |d Ed., c|hapter 9|
|000001d0| 2e 0d 0d 54 68 69 73 20 | 66 69 6c 65 20 61 6c 73 |...This |file als|
|000001e0| 6f 20 63 6f 6e 74 61 69 | 6e 73 20 73 65 76 65 72 |o contai|ns sever|
|000001f0| 61 6c 20 6f 74 68 65 72 | 20 68 65 6c 70 66 75 6c |al other| helpful|
|00000200| 20 72 6f 75 74 69 6e 65 | 73 20 74 68 61 74 20 64 | routine|s that d|
|00000210| 65 61 6c 20 77 69 74 68 | 20 76 69 64 65 6f 0d 64 |eal with| video.d|
|00000220| 65 76 69 63 65 20 64 72 | 69 76 65 72 73 2e 20 46 |evice dr|ivers. F|
|00000230| 6f 72 20 62 61 63 6b 67 | 72 6f 75 6e 64 2c 20 72 |or backg|round, r|
|00000240| 65 61 64 20 d2 56 69 64 | 65 6f 20 73 79 6e 63 68 |ead .Vid|eo synch|
|00000250| d3 2e 0d 20 0d 48 4f 57 | 20 54 4f 20 4c 4f 41 44 |... .HOW| TO LOAD|
|00000260| 20 54 48 45 20 43 4c 55 | 54 3a 0d 0d 4d 6f 73 74 | THE CLU|T:..Most|
|00000270| 20 70 65 6f 70 6c 65 20 | 72 65 61 64 69 6e 67 20 | people |reading |
|00000280| 74 68 69 73 20 66 69 6c | 65 20 73 69 6d 70 6c 79 |this fil|e simply|
|00000290| 20 77 61 6e 74 20 74 6f | 20 6b 6e 6f 77 20 68 6f | want to| know ho|
|000002a0| 77 20 74 6f 20 6c 6f 61 | 64 20 74 68 65 20 63 6c |w to loa|d the cl|
|000002b0| 75 74 2e 20 48 65 72 65 | 27 73 0d 74 68 65 20 63 |ut. Here|'s.the c|
|000002c0| 6f 64 65 20 66 72 61 67 | 6d 65 6e 74 20 79 6f 75 |ode frag|ment you|
|000002d0| 20 6e 65 65 64 2e 20 28 | 59 6f 75 20 6d 61 79 20 | need. (|You may |
|000002e0| 61 6c 73 6f 20 77 61 6e | 74 20 74 6f 20 6c 6f 6f |also wan|t to loo|
|000002f0| 6b 20 61 74 20 74 68 65 | 20 64 65 6d 6f 20 47 72 |k at the| demo Gr|
|00000300| 61 74 69 6e 67 2e 63 29 | 0d 0d 23 69 6e 63 6c 75 |ating.c)|..#inclu|
|00000310| 64 65 20 22 56 69 64 65 | 6f 54 6f 6f 6c 62 6f 78 |de "Vide|oToolbox|
|00000320| 2e 68 22 0d 76 6f 69 64 | 20 6d 61 69 6e 28 76 6f |.h".void| main(vo|
|00000330| 69 64 29 0d 7b 0d 09 69 | 6e 74 20 69 2c 65 72 72 |id).{..i|nt i,err|
|00000340| 6f 72 2c 63 6c 75 74 53 | 69 7a 65 3b 0d 09 47 44 |or,clutS|ize;..GD|
|00000350| 48 61 6e 64 6c 65 20 64 | 65 76 69 63 65 3b 0d 09 |Handle d|evice;..|
|00000360| 73 74 61 74 69 63 20 43 | 6f 6c 6f 72 53 70 65 63 |static C|olorSpec|
|00000370| 20 74 61 62 6c 65 5b 32 | 35 36 5d 3b 2f 2f 20 32 | table[2|56];// 2|
|00000380| 35 36 2a 34 2a 32 3d 32 | 6b 42 20 69 73 20 61 20 |56*4*2=2|kB is a |
|00000390| 6c 6f 74 20 74 6f 20 70 | 75 74 20 6f 6e 20 74 68 |lot to p|ut on th|
|000003a0| 65 20 73 74 61 63 6b 2c | 20 73 6f 0d 09 09 09 09 |e stack,| so.....|
|000003b0| 09 09 09 09 2f 2f 20 77 | 65 20 73 61 79 20 22 73 |....// w|e say "s|
|000003c0| 74 61 74 69 63 27 20 74 | 6f 20 70 75 74 20 69 74 |tatic' t|o put it|
|000003d0| 20 69 6e 20 74 68 65 20 | 68 65 61 70 20 69 6e 73 | in the |heap ins|
|000003e0| 74 65 61 64 2c 20 0d 09 | 09 09 09 09 09 09 09 2f |tead, ..|......./|
|000003f0| 2f 20 61 6e 64 20 79 6f | 75 20 73 68 6f 75 6c 64 |/ and yo|u should|
|00000400| 20 74 6f 6f 2c 20 75 6e | 6c 65 73 73 20 79 6f 75 | too, un|less you|
|00000410| 27 72 65 20 67 6f 69 6e | 67 20 74 6f 20 74 61 6b |'re goin|g to tak|
|00000420| 65 20 0d 09 09 09 09 09 | 09 09 09 2f 2f 20 73 70 |e ......|...// sp|
|00000430| 65 63 69 61 6c 20 63 61 | 72 65 20 6e 6f 74 20 74 |ecial ca|re not t|
|00000440| 6f 20 6f 76 65 72 66 6c | 6f 77 20 74 68 65 20 73 |o overfl|ow the s|
|00000450| 74 61 63 6b 2e 0d 09 52 | 65 71 75 69 72 65 28 67 |tack...R|equire(g|
|00000460| 65 73 74 61 6c 74 38 42 | 69 74 51 44 29 3b 0d 09 |estalt8B|itQD);..|
|00000470| 64 65 76 69 63 65 3d 47 | 65 74 53 63 72 65 65 6e |device=G|etScreen|
|00000480| 44 65 76 69 63 65 28 30 | 29 3b 0d 09 47 44 53 61 |Device(0|);..GDSa|
|00000490| 76 65 47 61 6d 6d 61 28 | 64 65 76 69 63 65 29 3b |veGamma(|device);|
|000004a0| 0d 09 47 44 55 6e 63 6f | 72 72 65 63 74 65 64 47 |..GDUnco|rrectedG|
|000004b0| 61 6d 6d 61 28 64 65 76 | 69 63 65 29 3b 09 2f 2f |amma(dev|ice);.//|
|000004c0| 20 54 65 6c 6c 20 74 68 | 65 20 64 72 69 76 65 72 | Tell th|e driver|
|000004d0| 20 74 6f 20 66 61 69 74 | 68 66 75 6c 6c 79 20 63 | to fait|hfully c|
|000004e0| 6f 70 79 20 6f 75 72 20 | 63 6f 6c 6f 72 73 20 69 |opy our |colors i|
|000004f0| 6e 74 6f 20 0d 09 09 09 | 09 09 09 09 09 2f 2f 20 |nto ....|.....// |
|00000500| 74 68 65 20 63 6c 75 74 | 20 77 69 74 68 6f 75 74 |the clut| without|
|00000510| 20 61 6e 79 20 74 72 61 | 6e 73 66 6f 72 6d 61 74 | any tra|nsformat|
|00000520| 69 6f 6e 2e 0d 09 63 6c | 75 74 53 69 7a 65 3d 28 |ion...cl|utSize=(|
|00000530| 2a 2a 28 2a 2a 28 2a 2a | 64 65 76 69 63 65 29 2e |**(**(**|device).|
|00000540| 67 64 50 4d 61 70 29 2e | 70 6d 54 61 62 6c 65 29 |gdPMap).|pmTable)|
|00000550| 2e 63 74 53 69 7a 65 2b | 31 3b 0d 09 66 6f 72 28 |.ctSize+|1;..for(|
|00000560| 69 3d 30 3b 69 3c 63 6c | 75 74 53 69 7a 65 3b 69 |i=0;i<cl|utSize;i|
|00000570| 2b 2b 29 7b 0d 09 09 2f | 2f 20 43 6f 6c 6f 72 73 |++){.../|/ Colors|
|00000580| 20 61 72 65 20 73 70 65 | 63 69 66 69 65 64 20 61 | are spe|cified a|
|00000590| 73 20 72 67 62 20 74 72 | 69 70 6c 65 74 73 20 6f |s rgb tr|iplets o|
|000005a0| 66 20 31 36 2d 62 69 74 | 20 75 6e 73 69 67 6e 65 |f 16-bit| unsigne|
|000005b0| 64 20 76 61 6c 75 65 73 | 2e 0d 09 09 2f 2f 20 54 |d values|....// T|
|000005c0| 68 65 20 68 61 72 64 77 | 61 72 65 20 75 73 65 73 |he hardw|are uses|
|000005d0| 20 74 68 65 20 6d 6f 73 | 74 20 73 69 67 6e 69 66 | the mos|t signif|
|000005e0| 69 63 61 6e 74 20 62 69 | 74 73 2c 20 74 79 70 69 |icant bi|ts, typi|
|000005f0| 63 61 6c 6c 79 20 38 2c | 20 62 75 74 20 70 6f 73 |cally 8,| but pos|
|00000600| 73 69 62 6c 79 20 6d 6f | 72 65 2e 0d 09 09 2f 2f |sibly mo|re....//|
|00000610| 20 48 65 72 65 20 77 65 | 20 63 6f 6d 70 75 74 65 | Here we| compute|
|00000620| 20 61 20 6c 69 6e 65 61 | 72 20 67 72 61 79 20 73 | a linea|r gray s|
|00000630| 63 61 6c 65 2e 20 0d 09 | 09 2f 2f 20 59 6f 75 20 |cale. ..|.// You |
|00000640| 63 6f 75 6c 64 20 72 65 | 70 6c 61 63 65 20 30 78 |could re|place 0x|
|00000650| 66 66 66 66 20 62 79 20 | 55 53 48 52 54 5f 4d 41 |ffff by |USHRT_MA|
|00000660| 58 2c 20 64 65 66 69 6e | 65 64 20 69 6e 20 6c 69 |X, defin|ed in li|
|00000670| 6d 69 74 73 2e 68 2c 20 | 69 66 20 79 6f 75 20 77 |mits.h, |if you w|
|00000680| 6f 75 6c 64 0d 09 09 2f | 2f 20 66 69 6e 64 20 74 |ould.../|/ find t|
|00000690| 68 61 74 20 6d 6f 72 65 | 20 72 65 61 64 61 62 6c |hat more| readabl|
|000006a0| 65 2e 0d 09 09 74 61 62 | 6c 65 5b 69 5d 2e 72 67 |e....tab|le[i].rg|
|000006b0| 62 2e 72 65 64 3d 74 61 | 62 6c 65 5b 69 5d 2e 72 |b.red=ta|ble[i].r|
|000006c0| 67 62 2e 67 72 65 65 6e | 3d 74 61 62 6c 65 5b 69 |gb.green|=table[i|
|000006d0| 5d 2e 72 67 62 2e 62 6c | 75 65 3d 69 2a 28 6c 6f |].rgb.bl|ue=i*(lo|
|000006e0| 6e 67 29 30 78 66 66 66 | 66 2f 28 63 6c 75 74 53 |ng)0xfff|f/(clutS|
|000006f0| 69 7a 65 2d 31 29 3b 0d | 09 7d 0d 09 47 44 53 65 |ize-1);.|.}..GDSe|
|00000700| 74 45 6e 74 72 69 65 73 | 42 79 54 79 70 65 28 64 |tEntries|ByType(d|
|00000710| 65 76 69 63 65 2c 30 2c | 63 6c 75 74 53 69 7a 65 |evice,0,|clutSize|
|00000720| 2d 31 2c 74 61 62 6c 65 | 29 3b 0d 7d 0d 0d 47 45 |-1,table|);.}..GE|
|00000730| 54 54 49 4e 47 20 54 48 | 45 20 43 4c 55 54 20 53 |TTING TH|E CLUT S|
|00000740| 49 5a 45 3a 0d 0d 54 6f | 20 75 73 65 20 73 6f 6d |IZE:..To| use som|
|00000750| 65 20 6f 66 20 66 6f 6c | 6c 6f 77 69 6e 67 20 63 |e of fol|lowing c|
|00000760| 61 6c 6c 73 20 79 6f 75 | 27 6c 6c 20 6e 65 65 64 |alls you|'ll need|
|00000770| 20 74 6f 20 6b 6e 6f 77 | 20 68 6f 77 20 6d 61 6e | to know| how man|
|00000780| 79 20 65 6e 74 72 69 65 | 73 20 74 68 65 72 65 20 |y entrie|s there |
|00000790| 61 72 65 20 69 6e 0d 74 | 68 65 20 63 6c 75 74 2c |are in.t|he clut,|
|000007a0| 20 77 68 69 63 68 20 49 | 20 63 61 6c 6c 20 74 68 | which I| call th|
|000007b0| 65 20 63 6c 75 74 53 69 | 7a 65 2e 20 54 68 65 20 |e clutSi|ze. The |
|000007c0| 63 6c 75 74 20 65 6e 74 | 72 69 65 73 20 61 72 65 |clut ent|ries are|
|000007d0| 20 6e 75 6d 62 65 72 65 | 64 20 30 20 74 6f 0d 63 | numbere|d 0 to.c|
|000007e0| 6c 75 74 53 69 7a 65 2d | 31 2e 20 45 2e 67 2e 20 |lutSize-|1. E.g. |
|000007f0| 69 6e 20 34 2d 62 69 74 | 20 6d 6f 64 65 20 74 68 |in 4-bit| mode th|
|00000800| 65 72 65 20 61 72 65 20 | 31 36 20 65 6e 74 72 69 |ere are |16 entri|
|00000810| 65 73 2c 20 6e 75 6d 62 | 65 72 65 64 20 30 20 74 |es, numb|ered 0 t|
|00000820| 6f 20 31 35 3b 20 69 6e | 20 38 2d 62 69 74 0d 6d |o 15; in| 8-bit.m|
|00000830| 6f 64 65 20 74 68 65 72 | 65 20 61 72 65 20 32 35 |ode ther|e are 25|
|00000840| 36 20 65 6e 74 72 69 65 | 73 2c 20 6e 75 6d 62 65 |6 entrie|s, numbe|
|00000850| 72 65 64 20 30 20 74 6f | 20 32 35 35 2e 20 51 75 |red 0 to| 255. Qu|
|00000860| 69 63 6b 44 72 61 77 20 | 6b 65 65 70 73 20 74 68 |ickDraw |keeps th|
|00000870| 65 20 63 75 72 72 65 6e | 74 20 63 6c 75 74 0d 73 |e curren|t clut.s|
|00000880| 69 7a 65 2c 20 6d 69 6e | 75 73 20 31 2c 20 69 6e |ize, min|us 1, in|
|00000890| 20 74 68 65 20 63 74 53 | 69 7a 65 20 66 69 65 6c | the ctS|ize fiel|
|000008a0| 64 2c 20 77 68 69 63 68 | 20 79 6f 75 20 63 61 6e |d, which| you can|
|000008b0| 20 61 63 63 65 73 73 20 | 61 73 20 66 6f 6c 6c 6f | access |as follo|
|000008c0| 77 73 3a 0d 0d 63 6c 75 | 74 53 69 7a 65 3d 28 2a |ws:..clu|tSize=(*|
|000008d0| 2a 28 2a 2a 28 2a 2a 64 | 65 76 69 63 65 29 2e 67 |*(**(**d|evice).g|
|000008e0| 64 50 4d 61 70 29 2e 70 | 6d 54 61 62 6c 65 29 2e |dPMap).p|mTable).|
|000008f0| 63 74 53 69 7a 65 2b 31 | 3b 0d 0d 48 6f 77 65 76 |ctSize+1|;..Howev|
|00000900| 65 72 2c 20 69 66 20 79 | 6f 75 20 6d 69 67 68 74 |er, if y|ou might|
|00000910| 20 68 61 76 65 20 63 68 | 61 6e 67 65 64 20 74 68 | have ch|anged th|
|00000920| 65 20 70 69 78 65 6c 20 | 73 69 7a 65 20 77 69 74 |e pixel |size wit|
|00000930| 68 6f 75 74 20 69 6e 66 | 6f 72 6d 69 6e 67 20 51 |hout inf|orming Q|
|00000940| 75 69 63 6b 44 72 61 77 | 2c 0d 69 2e 65 2e 20 62 |uickDraw|,.i.e. b|
|00000950| 79 20 63 61 6c 6c 69 6e | 67 20 47 44 53 65 74 4d |y callin|g GDSetM|
|00000960| 6f 64 65 2c 20 74 68 65 | 6e 20 79 6f 75 20 73 68 |ode, the|n you sh|
|00000970| 6f 75 6c 64 20 67 65 74 | 20 74 68 65 20 63 6c 75 |ould get| the clu|
|00000980| 74 20 73 69 7a 65 20 62 | 79 20 63 61 6c 6c 69 6e |t size b|y callin|
|00000990| 67 0d 47 44 43 6c 75 74 | 53 69 7a 65 28 29 3a 0d |g.GDClut|Size():.|
|000009a0| 0d 63 6c 75 74 53 69 7a | 65 3d 47 44 43 6c 75 74 |.clutSiz|e=GDClut|
|000009b0| 53 69 7a 65 28 64 65 76 | 69 63 65 29 3b 0d 0d 54 |Size(dev|ice);..T|
|000009c0| 48 45 20 4d 4f 53 54 20 | 55 53 45 46 55 4c 20 43 |HE MOST |USEFUL C|
|000009d0| 41 4c 4c 53 3a 0d 0d 73 | 68 6f 72 74 20 47 44 43 |ALLS:..s|hort GDC|
|000009e0| 6c 75 74 53 69 7a 65 28 | 47 44 48 61 6e 64 6c 65 |lutSize(|GDHandle|
|000009f0| 20 64 65 76 69 63 65 29 | 3b 0d 52 65 74 75 72 6e | device)|;.Return|
|00000a00| 73 20 74 68 65 20 6e 75 | 6d 62 65 72 20 6f 66 20 |s the nu|mber of |
|00000a10| 65 6e 74 72 69 65 73 20 | 69 6e 20 74 68 65 20 76 |entries |in the v|
|00000a20| 69 64 65 6f 20 64 72 69 | 76 65 72 27 73 20 63 6c |ideo dri|ver's cl|
|00000a30| 75 74 20 69 6e 20 74 68 | 65 20 63 75 72 72 65 6e |ut in th|e curren|
|00000a40| 74 20 76 69 64 65 6f 20 | 6d 6f 64 65 20 0d 28 69 |t video |mode .(i|
|00000a50| 2e 65 2e 20 63 75 72 72 | 65 6e 74 20 70 69 78 65 |.e. curr|ent pixe|
|00000a60| 6c 20 73 69 7a 65 29 2e | 0d 0d 4f 53 45 72 72 20 |l size).|..OSErr |
|00000a70| 47 44 52 65 73 74 6f 72 | 65 44 65 76 69 63 65 43 |GDRestor|eDeviceC|
|00000a80| 6c 75 74 28 47 44 48 61 | 6e 64 6c 65 20 64 65 76 |lut(GDHa|ndle dev|
|00000a90| 69 63 65 29 3b 0d 4e 6f | 6d 69 6e 61 6c 6c 79 20 |ice);.No|minally |
|00000aa0| 65 71 75 69 76 61 6c 65 | 6e 74 20 74 6f 20 41 70 |equivale|nt to Ap|
|00000ab0| 70 6c 65 27 73 20 52 65 | 73 74 6f 72 65 44 65 76 |ple's Re|storeDev|
|00000ac0| 69 63 65 43 6c 75 74 28 | 29 2c 20 77 68 69 63 68 |iceClut(|), which|
|00000ad0| 20 69 73 20 6f 6e 6c 79 | 20 61 76 61 69 6c 61 62 | is only| availab|
|00000ae0| 6c 65 0d 73 69 6e 63 65 | 20 53 79 73 74 65 6d 20 |le.since| System |
|00000af0| 36 2e 30 35 2e 20 48 6f | 77 65 76 65 72 2c 20 49 |6.05. Ho|wever, I|
|00000b00| 20 66 69 6e 64 20 74 68 | 61 74 20 41 70 70 6c 65 | find th|at Apple|
|00000b10| 27 73 20 72 6f 75 74 69 | 6e 65 20 73 6f 6d 65 74 |'s routi|ne somet|
|00000b20| 69 6d 65 73 20 64 6f 65 | 73 20 6e 6f 74 68 69 6e |imes doe|s nothin|
|00000b30| 67 2c 0d 77 68 65 72 65 | 61 73 20 74 68 69 73 20 |g,.where|as this |
|00000b40| 72 6f 75 74 69 6e 65 20 | 61 6c 77 61 79 73 20 77 |routine |always w|
|00000b50| 6f 72 6b 73 2e 20 50 61 | 73 73 69 6e 67 20 61 20 |orks. Pa|ssing a |
|00000b60| 4e 55 4c 4c 20 61 72 67 | 75 6d 65 6e 74 20 63 61 |NULL arg|ument ca|
|00000b70| 75 73 65 73 20 72 65 73 | 74 6f 72 61 74 69 6f 6e |uses res|toration|
|00000b80| 20 6f 66 0d 63 6c 75 74 | 73 20 6f 66 20 61 6c 6c | of.clut|s of all|
|00000b90| 20 76 69 64 65 6f 20 64 | 65 76 69 63 65 73 2e 0d | video d|evices..|
|00000ba0| 0d 4f 53 45 72 72 20 47 | 44 53 65 74 45 6e 74 72 |.OSErr G|DSetEntr|
|00000bb0| 69 65 73 42 79 54 79 70 | 65 28 47 44 48 61 6e 64 |iesByTyp|e(GDHand|
|00000bc0| 6c 65 20 64 65 76 69 63 | 65 2c 73 68 6f 72 74 20 |le devic|e,short |
|00000bd0| 73 74 61 72 74 2c 73 68 | 6f 72 74 20 63 6f 75 6e |start,sh|ort coun|
|00000be0| 74 2c 43 6f 6c 6f 72 53 | 70 65 63 20 2a 74 61 62 |t,ColorS|pec *tab|
|00000bf0| 6c 65 29 3b 0d 43 68 65 | 63 6b 73 20 74 68 65 20 |le);.Che|cks the |
|00000c00| 28 2a 2a 64 65 76 69 63 | 65 29 2e 67 64 54 79 70 |(**devic|e).gdTyp|
|00000c10| 65 20 66 69 65 6c 64 20 | 61 6e 64 20 63 61 6c 6c |e field |and call|
|00000c20| 73 20 47 44 53 65 74 45 | 6e 74 72 69 65 73 2c 20 |s GDSetE|ntries, |
|00000c30| 47 44 44 69 72 65 63 74 | 53 65 74 45 6e 74 72 69 |GDDirect|SetEntri|
|00000c40| 65 73 2c 0d 6f 72 20 6e | 6f 74 68 69 6e 67 2c 20 |es,.or n|othing, |
|00000c50| 61 73 20 61 70 70 72 6f | 70 72 69 61 74 65 2e 0d |as appro|priate..|
|00000c60| 0d 4f 53 45 72 72 20 47 | 44 53 65 74 45 6e 74 72 |.OSErr G|DSetEntr|
|00000c70| 69 65 73 42 79 54 79 70 | 65 48 69 67 68 50 72 69 |iesByTyp|eHighPri|
|00000c80| 6f 72 69 74 79 28 47 44 | 48 61 6e 64 6c 65 20 64 |ority(GD|Handle d|
|00000c90| 65 76 69 63 65 2c 73 68 | 6f 72 74 20 73 74 61 72 |evice,sh|ort star|
|00000ca0| 74 2c 73 68 6f 72 74 20 | 63 6f 75 6e 74 0d 09 2c |t,short |count..,|
|00000cb0| 43 6f 6c 6f 72 53 70 65 | 63 20 2a 74 61 62 6c 65 |ColorSpe|c *table|
|00000cc0| 29 3b 0d 43 61 6c 6c 73 | 20 47 44 53 65 74 45 6e |);.Calls| GDSetEn|
|00000cd0| 74 72 69 65 73 42 79 54 | 79 70 65 28 29 20 77 68 |triesByT|ype() wh|
|00000ce0| 69 6c 65 20 74 68 65 20 | 70 72 6f 63 65 73 73 6f |ile the |processo|
|00000cf0| 72 20 70 72 69 6f 72 69 | 74 79 20 68 61 73 20 62 |r priori|ty has b|
|00000d00| 65 65 6e 20 74 65 6d 70 | 6f 72 61 72 69 6c 79 20 |een temp|orarily |
|00000d10| 72 61 69 73 65 64 20 74 | 6f 20 37 2e 0d 0d 4f 53 |raised t|o 7...OS|
|00000d20| 45 72 72 20 47 44 53 65 | 74 45 6e 74 72 69 65 73 |Err GDSe|tEntries|
|00000d30| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00000d40| 2c 73 68 6f 72 74 20 73 | 74 61 72 74 2c 73 68 6f |,short s|tart,sho|
|00000d50| 72 74 20 63 6f 75 6e 74 | 2c 43 6f 6c 6f 72 53 70 |rt count|,ColorSp|
|00000d60| 65 63 20 2a 74 61 62 6c | 65 29 3b 0d 44 6f 65 73 |ec *tabl|e);.Does|
|00000d70| 20 61 20 6c 6f 77 2d 6c | 65 76 65 6c 20 73 65 74 | a low-l|evel set|
|00000d80| 45 6e 74 72 69 65 73 20 | 43 6f 6e 74 72 6f 6c 20 |Entries |Control |
|00000d90| 63 61 6c 6c 20 74 6f 20 | 74 68 65 20 76 69 64 65 |call to |the vide|
|00000da0| 6f 20 63 61 72 64 27 73 | 20 64 72 69 76 65 72 2c |o card's| driver,|
|00000db0| 20 6c 6f 61 64 69 6e 67 | 20 61 6e 79 0d 6e 75 6d | loading| any.num|
|00000dc0| 62 65 72 20 6f 66 20 63 | 6c 75 74 20 65 6e 74 72 |ber of c|lut entr|
|00000dd0| 69 65 73 20 77 69 74 68 | 20 61 72 62 69 74 72 61 |ies with| arbitra|
|00000de0| 72 79 20 72 67 62 20 74 | 72 69 70 6c 65 74 73 2e |ry rgb t|riplets.|
|00000df0| 20 28 4e 6f 74 65 20 74 | 68 61 74 20 74 68 65 20 | (Note t|hat the |
|00000e00| 64 72 69 76 65 72 20 77 | 69 6c 6c 0d 74 72 61 6e |driver w|ill.tran|
|00000e10| 73 66 6f 72 6d 20 79 6f | 75 72 20 72 67 62 20 74 |sform yo|ur rgb t|
|00000e20| 72 69 70 6c 65 74 73 20 | 76 69 61 20 74 68 65 20 |riplets |via the |
|00000e30| 67 61 6d 6d 61 20 74 61 | 62 6c 65 20 62 65 66 6f |gamma ta|ble befo|
|00000e40| 72 65 20 6c 6f 61 64 69 | 6e 67 20 74 68 65 6d 20 |re loadi|ng them |
|00000e50| 69 6e 74 6f 20 74 68 65 | 0d 63 6c 75 74 3b 20 73 |into the|.clut; s|
|00000e60| 6f 20 63 61 6c 6c 20 47 | 44 55 6e 63 6f 72 72 65 |o call G|DUncorre|
|00000e70| 63 74 65 64 47 61 6d 6d | 61 20 66 69 72 73 74 2e |ctedGamm|a first.|
|00000e80| 29 20 22 64 65 76 69 63 | 65 22 20 73 70 65 63 69 |) "devic|e" speci|
|00000e90| 66 69 65 73 20 77 68 69 | 63 68 20 76 69 64 65 6f |fies whi|ch video|
|00000ea0| 20 64 65 76 69 63 65 27 | 73 0d 63 6c 75 74 20 79 | device'|s.clut y|
|00000eb0| 6f 75 20 77 61 6e 74 20 | 74 6f 20 6c 6f 61 64 2e |ou want |to load.|
|00000ec0| 20 22 73 74 61 72 74 22 | 20 69 73 20 65 69 74 68 | "start"| is eith|
|00000ed0| 65 72 20 69 6e 20 74 68 | 65 20 72 61 6e 67 65 20 |er in th|e range |
|00000ee0| 30 20 74 6f 20 63 6c 75 | 74 53 69 7a 65 2d 31 2c |0 to clu|tSize-1,|
|00000ef0| 0d 69 6e 64 69 63 61 74 | 69 6e 67 20 77 68 69 63 |.indicat|ing whic|
|00000f00| 68 20 63 6c 75 74 20 65 | 6e 74 72 79 20 74 6f 20 |h clut e|ntry to |
|00000f10| 6c 6f 61 64 20 66 69 72 | 73 74 20 28 69 6e 20 22 |load fir|st (in "|
|00000f20| 73 65 71 75 65 6e 63 65 | 20 6d 6f 64 65 22 29 2c |sequence| mode"),|
|00000f30| 20 6f 72 20 69 73 20 2d | 31 0d 28 72 65 71 75 65 | or is -|1.(reque|
|00000f40| 73 74 69 6e 67 20 22 69 | 6e 64 65 78 20 6d 6f 64 |sting "i|ndex mod|
|00000f50| 65 22 29 2e 20 22 63 6f | 75 6e 74 22 20 69 73 20 |e"). "co|unt" is |
|00000f60| 74 68 65 20 6e 75 6d 62 | 65 72 20 6f 66 20 65 6e |the numb|er of en|
|00000f70| 74 72 69 65 73 20 74 6f | 20 62 65 20 6d 6f 64 69 |tries to| be modi|
|00000f80| 66 69 65 64 2c 0d 6d 69 | 6e 75 73 20 31 2e 20 22 |fied,.mi|nus 1. "|
|00000f90| 74 61 62 6c 65 22 20 69 | 73 20 61 20 43 6f 6c 6f |table" i|s a Colo|
|00000fa0| 72 53 70 65 63 20 61 72 | 72 61 79 20 28 6e 6f 74 |rSpec ar|ray (not|
|00000fb0| 20 61 20 43 6f 6c 6f 72 | 54 61 62 6c 65 29 20 63 | a Color|Table) c|
|00000fc0| 6f 6e 74 61 69 6e 69 6e | 67 20 74 68 65 20 72 67 |ontainin|g the rg|
|00000fd0| 62 0d 74 72 69 70 6c 65 | 74 73 20 74 68 61 74 20 |b.triple|ts that |
|00000fe0| 79 6f 75 20 77 61 6e 74 | 20 74 6f 20 6c 6f 61 64 |you want| to load|
|00000ff0| 20 69 6e 74 6f 20 74 68 | 65 20 63 6c 75 74 2e 20 | into th|e clut. |
|00001000| 49 6e 20 73 65 71 75 65 | 6e 63 65 20 6d 6f 64 65 |In seque|nce mode|
|00001010| 20 22 73 74 61 72 74 22 | 20 6d 75 73 74 20 62 65 | "start"| must be|
|00001020| 0d 69 6e 20 74 68 65 20 | 72 61 6e 67 65 20 30 20 |.in the |range 0 |
|00001030| 74 6f 20 63 6c 75 74 53 | 69 7a 65 2d 31 2c 20 74 |to clutS|ize-1, t|
|00001040| 68 65 20 69 2d 74 68 20 | 65 6c 65 6d 65 6e 74 20 |he i-th |element |
|00001050| 6f 66 20 74 61 62 6c 65 | 20 63 6f 72 72 65 73 70 |of table| corresp|
|00001060| 6f 6e 64 73 20 74 6f 20 | 74 68 65 0d 69 2b 73 74 |onds to |the.i+st|
|00001070| 61 72 74 20 65 6e 74 72 | 79 20 69 6e 20 74 68 65 |art entr|y in the|
|00001080| 20 63 6c 75 74 2c 20 61 | 6e 64 20 74 68 65 20 22 | clut, a|nd the "|
|00001090| 76 61 6c 75 65 22 20 66 | 69 65 6c 64 20 6f 66 20 |value" f|ield of |
|000010a0| 65 61 63 68 20 65 6c 65 | 6d 65 6e 74 20 6f 66 20 |each ele|ment of |
|000010b0| 74 61 62 6c 65 20 69 73 | 0d 69 67 6e 6f 72 65 64 |table is|.ignored|
|000010c0| 2e 20 49 6e 20 69 6e 64 | 65 78 20 6d 6f 64 65 20 |. In ind|ex mode |
|000010d0| 22 73 74 61 72 74 22 20 | 6d 75 73 74 20 62 65 20 |"start" |must be |
|000010e0| 2d 31 2c 20 61 6e 64 20 | 74 68 65 20 22 76 61 6c |-1, and |the "val|
|000010f0| 75 65 22 20 66 69 65 6c | 64 20 6f 66 20 65 61 63 |ue" fiel|d of eac|
|00001100| 68 20 65 6c 65 6d 65 6e | 74 0d 6f 66 20 74 61 62 |h elemen|t.of tab|
|00001110| 6c 65 20 69 6e 64 69 63 | 61 74 65 73 20 77 68 69 |le indic|ates whi|
|00001120| 63 68 20 63 6c 75 74 20 | 65 6e 74 72 79 20 74 6f |ch clut |entry to|
|00001130| 20 6c 6f 61 64 20 69 74 | 20 69 6e 74 6f 2e 20 54 | load it| into. T|
|00001140| 68 65 20 61 72 67 75 6d | 65 6e 74 73 20 73 74 61 |he argum|ents sta|
|00001150| 72 74 2c 0d 63 6f 75 6e | 74 2c 20 61 6e 64 20 74 |rt,.coun|t, and t|
|00001160| 61 62 6c 65 20 61 72 65 | 20 74 68 65 20 73 61 6d |able are| the sam|
|00001170| 65 20 61 73 20 66 6f 72 | 20 74 68 65 20 43 6f 6c |e as for| the Col|
|00001180| 6f 72 20 4d 61 6e 61 67 | 65 72 20 63 61 6c 6c 20 |or Manag|er call |
|00001190| 53 65 74 45 6e 74 72 69 | 65 73 28 29 2c 0d 64 6f |SetEntri|es(),.do|
|000011a0| 63 75 6d 65 6e 74 65 64 | 20 69 6e 20 49 6e 73 69 |cumented| in Insi|
|000011b0| 64 65 20 4d 61 63 69 6e | 74 6f 73 68 20 56 2d 31 |de Macin|tosh V-1|
|000011c0| 34 33 2e 20 28 4d 6f 73 | 74 20 64 72 69 76 65 72 |43. (Mos|t driver|
|000011d0| 73 20 77 61 69 74 20 66 | 6f 72 20 62 6c 61 6e 6b |s wait f|or blank|
|000011e0| 69 6e 67 20 62 65 66 6f | 72 65 0d 6d 6f 64 69 66 |ing befo|re.modif|
|000011f0| 79 69 6e 67 20 74 68 65 | 20 63 6c 75 74 2e 20 46 |ying the| clut. F|
|00001200| 6f 72 20 61 20 66 75 6c | 6c 20 64 69 73 63 75 73 |or a ful|l discus|
|00001210| 73 69 6f 6e 2c 20 72 65 | 61 64 20 74 68 65 20 22 |sion, re|ad the "|
|00001220| 56 69 64 65 6f 20 73 79 | 6e 63 68 22 20 66 69 6c |Video sy|nch" fil|
|00001230| 65 2e 29 20 59 6f 75 20 | 6d 61 79 0d 61 6c 73 6f |e.) You |may.also|
|00001240| 20 77 61 6e 74 20 74 6f | 20 6c 6f 6f 6b 20 61 74 | want to| look at|
|00001250| 20 74 68 65 20 66 69 6c | 65 20 53 65 74 45 6e 74 | the fil|e SetEnt|
|00001260| 72 69 65 73 51 75 69 63 | 6b 6c 79 2e 63 2c 20 77 |riesQuic|kly.c, w|
|00001270| 68 69 63 68 20 70 72 6f | 76 69 64 65 73 20 74 68 |hich pro|vides th|
|00001280| 65 0d 66 75 6e 63 74 69 | 6f 6e 61 6c 69 74 79 20 |e.functi|onality |
|00001290| 6f 66 20 47 44 53 65 74 | 45 6e 74 72 69 65 73 20 |of GDSet|Entries |
|000012a0| 61 6e 64 20 47 44 44 69 | 72 65 63 74 53 65 74 45 |and GDDi|rectSetE|
|000012b0| 6e 74 72 69 65 73 2c 20 | 62 75 74 20 62 79 70 61 |ntries, |but bypa|
|000012c0| 73 73 65 73 20 74 68 65 | 20 76 69 64 65 6f 0d 64 |sses the| video.d|
|000012d0| 72 69 76 65 72 20 74 6f | 20 61 63 63 65 73 73 20 |river to| access |
|000012e0| 74 68 65 20 68 61 72 64 | 77 61 72 65 20 64 69 72 |the hard|ware dir|
|000012f0| 65 63 74 6c 79 2e 0d 0d | 4f 53 45 72 72 20 47 44 |ectly...|OSErr GD|
|00001300| 44 69 72 65 63 74 53 65 | 74 45 6e 74 72 69 65 73 |DirectSe|tEntries|
|00001310| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00001320| 2c 73 68 6f 72 74 20 73 | 74 61 72 74 2c 73 68 6f |,short s|tart,sho|
|00001330| 72 74 20 63 6f 75 6e 74 | 2c 43 6f 6c 6f 72 53 70 |rt count|,ColorSp|
|00001340| 65 63 20 2a 74 61 62 6c | 65 29 3b 0d 49 66 20 79 |ec *tabl|e);.If y|
|00001350| 6f 75 72 20 70 69 78 65 | 6c 20 64 65 70 74 68 20 |our pixe|l depth |
|00001360| 69 73 20 3e 38 20 74 68 | 65 6e 20 74 68 65 20 73 |is >8 th|en the s|
|00001370| 65 74 45 6e 74 72 69 65 | 73 20 63 61 6c 6c 20 69 |etEntrie|s call i|
|00001380| 73 20 64 69 73 61 62 6c | 65 64 2c 20 61 6e 64 20 |s disabl|ed, and |
|00001390| 79 6f 75 20 6d 75 73 74 | 20 75 73 65 0d 74 68 69 |you must| use.thi|
|000013a0| 73 20 69 6e 73 74 65 61 | 64 20 6f 66 20 47 44 53 |s instea|d of GDS|
|000013b0| 65 74 45 6e 74 72 69 65 | 73 28 29 2e 0d 0d 4f 53 |etEntrie|s()...OS|
|000013c0| 45 72 72 20 47 44 47 65 | 74 45 6e 74 72 69 65 73 |Err GDGe|tEntries|
|000013d0| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|000013e0| 2c 73 68 6f 72 74 20 73 | 74 61 72 74 2c 73 68 6f |,short s|tart,sho|
|000013f0| 72 74 20 63 6f 75 6e 74 | 2c 43 6f 6c 6f 72 53 70 |rt count|,ColorSp|
|00001400| 65 63 20 2a 74 61 62 6c | 65 29 3b 0d 54 68 69 73 |ec *tabl|e);.This|
|00001410| 20 69 73 20 6d 75 63 68 | 20 61 73 20 79 6f 75 27 | is much| as you'|
|00001420| 64 20 65 78 70 65 63 74 | 20 61 66 74 65 72 20 72 |d expect| after r|
|00001430| 65 61 64 69 6e 67 20 47 | 44 53 65 74 45 6e 74 72 |eading G|DSetEntr|
|00001440| 69 65 73 20 61 62 6f 76 | 65 2e 20 4e 6f 74 65 20 |ies abov|e. Note |
|00001450| 74 68 61 74 20 75 6e 6c | 65 73 73 0d 74 68 65 20 |that unl|ess.the |
|00001460| 67 61 6d 6d 61 20 74 61 | 62 6c 65 20 69 73 20 6c |gamma ta|ble is l|
|00001470| 69 6e 65 61 72 2c 20 74 | 68 65 20 76 61 6c 75 65 |inear, t|he value|
|00001480| 73 20 72 65 74 75 72 6e | 65 64 20 6d 61 79 20 6e |s return|ed may n|
|00001490| 6f 74 20 62 65 20 74 68 | 65 20 73 61 6d 65 20 61 |ot be th|e same a|
|000014a0| 73 20 74 68 6f 73 65 0d | 6f 72 69 67 69 6e 61 6c |s those.|original|
|000014b0| 6c 79 20 70 61 73 73 65 | 64 20 62 79 20 47 44 53 |ly passe|d by GDS|
|000014c0| 65 74 45 6e 74 72 69 65 | 73 2e 20 53 6f 20 63 61 |etEntrie|s. So ca|
|000014d0| 6c 6c 20 47 44 55 6e 63 | 6f 72 72 65 63 74 65 64 |ll GDUnc|orrected|
|000014e0| 47 61 6d 6d 61 20 66 69 | 72 73 74 2e 20 54 72 79 |Gamma fi|rst. Try|
|000014f0| 20 74 68 65 20 64 65 6d | 6f 20 0d 54 69 6d 65 56 | the dem|o .TimeV|
|00001500| 69 64 65 6f 2e 0d 0d 4f | 53 45 72 72 20 47 44 55 |ideo...O|SErr GDU|
|00001510| 6e 63 6f 72 72 65 63 74 | 65 64 47 61 6d 6d 61 28 |ncorrect|edGamma(|
|00001520| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 29 |GDHandle| device)|
|00001530| 3b 0d 41 73 6b 73 20 47 | 44 53 65 74 47 61 6d 6d |;.Asks G|DSetGamm|
|00001540| 61 20 74 6f 20 6c 6f 61 | 64 20 61 20 6c 69 6e 65 |a to loa|d a line|
|00001550| 61 72 20 67 61 6d 6d 61 | 20 74 61 62 6c 65 2c 20 |ar gamma| table, |
|00001560| 69 2e 65 2e 20 6e 6f 20 | 63 6f 72 72 65 63 74 69 |i.e. no |correcti|
|00001570| 6f 6e 2e 20 28 54 68 65 | 0d 67 61 6d 6d 61 20 63 |on. (The|.gamma c|
|00001580| 6f 72 72 65 63 74 69 6f | 6e 20 69 6d 70 6c 65 6d |orrectio|n implem|
|00001590| 65 6e 74 65 64 20 62 79 | 20 74 61 62 6c 65 2d 6c |ented by| table-l|
|000015a0| 6f 6f 6b 75 70 20 69 6e | 20 74 68 65 20 76 69 64 |ookup in| the vid|
|000015b0| 65 6f 20 64 72 69 76 65 | 72 20 69 73 20 74 6f 6f |eo drive|r is too|
|000015c0| 0d 63 72 75 64 65 20 66 | 6f 72 20 65 78 70 65 72 |.crude f|or exper|
|000015d0| 69 6d 65 6e 74 73 20 74 | 68 61 74 20 77 61 6e 74 |iments t|hat want|
|000015e0| 20 61 63 63 75 72 61 74 | 65 20 6c 75 6d 69 6e 61 | accurat|e lumina|
|000015f0| 6e 63 65 20 63 6f 6e 74 | 72 6f 6c 2e 29 0d 0d 4f |nce cont|rol.)..O|
|00001600| 53 45 72 72 20 47 44 47 | 65 74 47 61 6d 6d 61 28 |SErr GDG|etGamma(|
|00001610| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 2c |GDHandle| device,|
|00001620| 47 61 6d 6d 61 54 62 6c | 20 2a 2a 6d 79 47 61 6d |GammaTbl| **myGam|
|00001630| 6d 61 54 62 6c 48 61 6e | 64 6c 65 29 3b 0d 52 65 |maTblHan|dle);.Re|
|00001640| 74 75 72 6e 73 20 61 20 | 70 6f 69 6e 74 65 72 20 |turns a |pointer |
|00001650| 74 6f 20 74 68 65 20 47 | 61 6d 6d 61 20 74 61 62 |to the G|amma tab|
|00001660| 6c 65 20 69 6e 20 74 68 | 65 20 73 70 65 63 69 66 |le in th|e specif|
|00001670| 69 65 64 20 76 69 64 65 | 6f 20 64 65 76 69 63 65 |ied vide|o device|
|00001680| 2e 20 28 49 2e 65 2e 20 | 79 6f 75 0d 70 61 73 73 |. (I.e. |you.pass|
|00001690| 20 69 74 20 61 20 70 6f | 69 6e 74 65 72 20 74 6f | it a po|inter to|
|000016a0| 20 79 6f 75 72 20 70 6f | 69 6e 74 65 72 2c 20 61 | your po|inter, a|
|000016b0| 20 68 61 6e 64 6c 65 2c | 20 77 68 69 63 68 20 69 | handle,| which i|
|000016c0| 74 20 75 73 65 73 20 74 | 6f 20 6c 6f 61 64 20 79 |t uses t|o load y|
|000016d0| 6f 75 72 0d 70 6f 69 6e | 74 65 72 2e 29 0d 0d 4f |our.poin|ter.)..O|
|000016e0| 53 45 72 72 20 47 44 53 | 65 74 47 61 6d 6d 61 28 |SErr GDS|etGamma(|
|000016f0| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 2c |GDHandle| device,|
|00001700| 20 47 61 6d 6d 61 54 62 | 6c 20 2a 67 61 6d 6d 61 | GammaTb|l *gamma|
|00001710| 29 3b 0d 4c 6f 61 64 73 | 20 61 20 47 61 6d 6d 61 |);.Loads| a Gamma|
|00001720| 20 74 61 62 6c 65 20 69 | 6e 74 6f 20 74 68 65 20 | table i|nto the |
|00001730| 73 70 65 63 69 66 69 65 | 64 20 76 69 64 65 6f 20 |specifie|d video |
|00001740| 64 65 76 69 63 65 2e 20 | 54 68 65 20 76 69 64 65 |device. |The vide|
|00001750| 6f 20 64 72 69 76 65 72 | 20 77 69 6c 6c 20 6d 61 |o driver| will ma|
|00001760| 6b 65 0d 61 20 63 6f 70 | 79 20 6f 66 20 79 6f 75 |ke.a cop|y of you|
|00001770| 72 20 74 61 62 6c 65 2e | 20 59 6f 75 20 63 61 6e |r table.| You can|
|00001780| 20 64 69 73 63 61 72 64 | 20 79 6f 75 72 20 74 61 | discard| your ta|
|00001790| 62 6c 65 20 61 66 74 65 | 72 20 6d 61 6b 69 6e 67 |ble afte|r making|
|000017a0| 20 74 68 69 73 20 63 61 | 6c 6c 2e 20 4e 6f 74 65 | this ca|ll. Note|
|000017b0| 0d 74 68 61 74 20 74 68 | 65 20 76 69 64 65 6f 20 |.that th|e video |
|000017c0| 64 72 69 76 65 72 20 6f | 6e 6c 79 20 75 73 65 73 |driver o|nly uses|
|000017d0| 20 74 68 65 20 67 61 6d | 6d 61 20 74 61 62 6c 65 | the gam|ma table|
|000017e0| 20 77 68 65 6e 20 70 65 | 72 66 6f 72 6d 69 6e 67 | when pe|rforming|
|000017f0| 20 53 65 74 45 6e 74 72 | 69 65 73 2c 20 69 2e 65 | SetEntr|ies, i.e|
|00001800| 2e 0d 77 68 65 6e 20 61 | 63 74 75 61 6c 6c 79 20 |..when a|ctually |
|00001810| 6c 6f 61 64 69 6e 67 20 | 74 68 65 20 63 6c 75 74 |loading |the clut|
|00001820| 2e 20 54 68 65 20 73 74 | 72 75 63 74 75 72 65 20 |. The st|ructure |
|00001830| 6f 66 20 74 68 65 20 67 | 61 6d 6d 61 20 74 61 62 |of the g|amma tab|
|00001840| 6c 65 20 69 73 20 28 66 | 69 6e 61 6c 6c 79 21 29 |le is (f|inally!)|
|00001850| 0d 64 6f 63 75 6d 65 6e | 74 65 64 20 69 6e 20 44 |.documen|ted in D|
|00001860| 65 73 69 67 6e 69 6e 67 | 20 43 61 72 64 73 20 61 |esigning| Cards a|
|00001870| 6e 64 20 44 72 69 76 65 | 72 73 2c 20 33 72 64 20 |nd Drive|rs, 3rd |
|00001880| 65 64 69 74 69 6f 6e 2c | 20 70 61 67 65 73 20 32 |edition,| pages 2|
|00001890| 31 35 2d 32 31 36 2e 20 | 42 65 77 61 72 65 20 6f |15-216. |Beware o|
|000018a0| 66 0d 61 20 64 69 73 63 | 72 65 70 61 6e 63 79 20 |f.a disc|repancy |
|000018b0| 62 65 74 77 65 65 6e 20 | 74 68 65 20 64 6f 63 75 |between |the docu|
|000018c0| 6d 65 6e 74 61 74 69 6f | 6e 20 61 6e 64 20 74 68 |mentatio|n and th|
|000018d0| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 69 6e 20 |e defini|tion in |
|000018e0| 51 75 69 63 6b 44 72 61 | 77 2e 68 3a 0d 67 46 6f |QuickDra|w.h:.gFo|
|000018f0| 72 6d 75 6c 61 44 61 74 | 61 20 69 73 20 64 65 73 |rmulaDat|a is des|
|00001900| 63 72 69 62 65 64 20 61 | 73 20 61 20 62 79 74 65 |cribed a|s a byte|
|00001910| 20 61 72 72 61 79 20 69 | 6e 20 74 68 65 20 74 65 | array i|n the te|
|00001920| 78 74 2c 20 62 75 74 20 | 69 73 20 64 65 63 6c 61 |xt, but |is decla|
|00001930| 72 65 64 20 61 73 20 61 | 0d 73 68 6f 72 74 20 61 |red as a|.short a|
|00001940| 72 72 61 79 20 69 6e 20 | 74 68 65 20 51 75 69 63 |rray in |the Quic|
|00001950| 6b 44 72 61 77 2e 68 20 | 68 65 61 64 65 72 20 66 |kDraw.h |header f|
|00001960| 69 6c 65 2e 0d 0d 4f 53 | 45 72 72 20 47 44 47 65 |ile...OS|Err GDGe|
|00001970| 74 4d 6f 64 65 28 47 44 | 48 61 6e 64 6c 65 20 64 |tMode(GD|Handle d|
|00001980| 65 76 69 63 65 2c 73 68 | 6f 72 74 20 2a 6d 6f 64 |evice,sh|ort *mod|
|00001990| 65 50 74 72 2c 73 68 6f | 72 74 20 2a 70 61 67 65 |ePtr,sho|rt *page|
|000019a0| 50 74 72 2c 50 74 72 20 | 2a 62 61 73 65 41 64 64 |Ptr,Ptr |*baseAdd|
|000019b0| 72 50 74 72 29 3b 0d 49 | 74 20 74 65 6c 6c 73 20 |rPtr);.I|t tells |
|000019c0| 79 6f 75 20 74 68 65 20 | 63 75 72 72 65 6e 74 20 |you the |current |
|000019d0| 6d 6f 64 65 2c 20 70 61 | 67 65 20 6f 66 20 76 69 |mode, pa|ge of vi|
|000019e0| 64 65 6f 20 6d 65 6d 6f | 72 79 2c 20 61 6e 64 20 |deo memo|ry, and |
|000019f0| 74 68 65 20 62 61 73 65 | 20 61 64 64 72 65 73 73 |the base| address|
|00001a00| 20 6f 66 20 74 68 61 74 | 0d 70 61 67 65 2e 0d 0d | of that|.page...|
|00001a10| 4f 53 45 72 72 20 47 44 | 53 65 74 4d 6f 64 65 28 |OSErr GD|SetMode(|
|00001a20| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 2c |GDHandle| device,|
|00001a30| 73 68 6f 72 74 20 6d 6f | 64 65 2c 73 68 6f 72 74 |short mo|de,short|
|00001a40| 20 70 61 67 65 2c 50 74 | 72 20 2a 62 61 73 65 41 | page,Pt|r *baseA|
|00001a50| 64 64 72 50 74 72 29 3b | 0d 59 6f 75 20 74 65 6c |ddrPtr);|.You tel|
|00001a60| 6c 20 69 74 20 77 68 61 | 74 20 6d 6f 64 65 20 61 |l it wha|t mode a|
|00001a70| 6e 64 20 76 69 64 65 6f | 20 70 61 67 65 20 79 6f |nd video| page yo|
|00001a80| 75 20 77 61 6e 74 2e 20 | 49 74 20 73 65 74 73 20 |u want. |It sets |
|00001a90| 27 65 6d 20 61 6e 64 20 | 72 65 74 75 72 6e 73 20 |'em and |returns |
|00001aa0| 74 68 65 20 62 61 73 65 | 0d 61 64 64 72 65 73 73 |the base|.address|
|00001ab0| 20 6f 66 20 74 68 61 74 | 20 70 61 67 65 20 69 6e | of that| page in|
|00001ac0| 20 76 69 64 65 6f 20 6d | 65 6d 6f 72 79 2e 20 41 | video m|emory. A|
|00001ad0| 6c 73 6f 2c 20 62 65 63 | 61 75 73 65 20 41 70 70 |lso, bec|ause App|
|00001ae0| 6c 65 20 73 61 69 64 20 | 73 6f 2c 20 74 68 65 20 |le said |so, the |
|00001af0| 76 69 64 65 6f 0d 64 72 | 69 76 65 72 20 73 65 74 |video.dr|iver set|
|00001b00| 73 20 74 68 65 20 65 6e | 74 69 72 65 20 63 6c 75 |s the en|tire clu|
|00001b10| 74 20 74 6f 20 35 30 25 | 20 67 72 61 79 2e 20 4e |t to 50%| gray. N|
|00001b20| 6f 74 65 20 74 68 61 74 | 20 74 68 69 73 20 63 68 |ote that| this ch|
|00001b30| 61 6e 67 65 73 20 74 68 | 69 6e 67 73 20 62 65 68 |anges th|ings beh|
|00001b40| 69 6e 64 0d 51 75 69 63 | 6b 44 72 61 77 27 73 20 |ind.Quic|kDraw's |
|00001b50| 62 61 63 6b 2e 20 46 6f | 72 20 6d 6f 73 74 20 61 |back. Fo|r most a|
|00001b60| 70 70 6c 69 63 61 74 69 | 6f 6e 73 20 6c 69 66 65 |pplicati|ons life|
|00001b70| 20 77 69 6c 6c 20 62 65 | 20 73 69 6d 70 6c 65 72 | will be| simpler|
|00001b80| 20 69 66 20 79 6f 75 20 | 6f 76 65 72 74 6c 79 20 | if you |overtly |
|00001b90| 61 73 6b 0d 51 75 69 63 | 6b 44 72 61 77 20 74 6f |ask.Quic|kDraw to|
|00001ba0| 20 74 61 6b 65 20 63 68 | 61 72 67 65 20 62 79 20 | take ch|arge by |
|00001bb0| 63 61 6c 6c 69 6e 67 20 | 41 70 70 6c 65 27 73 20 |calling |Apple's |
|00001bc0| 53 65 74 44 65 70 74 68 | 28 29 20 69 6e 73 74 65 |SetDepth|() inste|
|00001bd0| 61 64 20 6f 66 20 47 44 | 53 65 74 4d 6f 64 65 28 |ad of GD|SetMode(|
|00001be0| 29 2e 0d 41 70 70 6c 65 | 27 73 20 56 69 64 65 6f |)..Apple|'s Video|
|00001bf0| 2e 68 20 68 65 61 64 65 | 72 20 66 69 6c 65 20 64 |.h heade|r file d|
|00001c00| 65 66 69 6e 65 73 20 74 | 68 65 73 65 20 6e 61 6d |efines t|hese nam|
|00001c10| 65 73 3a 0d 62 69 74 73 | 09 63 6f 6c 6f 72 73 09 |es:.bits|.colors.|
|00001c20| 09 6d 6f 64 65 09 6e 61 | 6d 65 0d 2d 2d 2d 2d 2d |.mode.na|me.-----|
|00001c30| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001c40| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00001c50| 2d 0d 31 09 09 32 09 09 | 09 30 78 38 30 09 6f 6e |-.1..2..|.0x80.on|
|00001c60| 65 42 69 74 4d 6f 64 65 | 0d 32 09 09 34 09 09 09 |eBitMode|.2..4...|
|00001c70| 30 58 38 31 09 74 77 6f | 42 69 74 4d 6f 64 65 0d |0X81.two|BitMode.|
|00001c80| 34 09 09 31 36 09 09 09 | 30 58 38 32 09 66 6f 75 |4..16...|0X82.fou|
|00001c90| 72 42 69 74 4d 6f 64 65 | 0d 38 09 09 32 35 36 09 |rBitMode|.8..256.|
|00001ca0| 09 09 30 58 38 33 09 65 | 69 67 68 74 42 69 74 4d |..0X83.e|ightBitM|
|00001cb0| 6f 64 65 0d 31 36 09 09 | 22 74 68 6f 75 73 61 6e |ode.16..|"thousan|
|00001cc0| 64 73 22 09 30 58 38 34 | 09 73 69 78 74 65 65 6e |ds".0X84|.sixteen|
|00001cd0| 42 69 74 4d 6f 64 65 0d | 33 32 09 09 22 6d 69 6c |BitMode.|32.."mil|
|00001ce0| 6c 69 6f 6e 73 22 09 30 | 58 38 35 09 74 68 69 72 |lions".0|X85.thir|
|00001cf0| 74 79 54 77 6f 42 69 74 | 4d 6f 64 65 0d 0d 63 68 |tyTwoBit|Mode..ch|
|00001d00| 61 72 20 2a 47 44 4d 6f | 64 65 4e 61 6d 65 28 73 |ar *GDMo|deName(s|
|00001d10| 68 6f 72 74 20 6d 6f 64 | 65 29 3b 0d 52 65 74 75 |hort mod|e);.Retu|
|00001d20| 72 6e 73 20 74 68 65 20 | 6e 61 6d 65 2c 20 66 72 |rns the |name, fr|
|00001d30| 6f 6d 20 74 68 65 20 61 | 62 6f 76 65 20 74 61 62 |om the a|bove tab|
|00001d40| 6c 65 2c 20 61 73 20 61 | 20 43 20 73 74 72 69 6e |le, as a| C strin|
|00001d50| 67 2e 20 54 68 65 20 72 | 65 74 75 72 6e 65 64 20 |g. The r|eturned |
|00001d60| 6e 61 6d 65 20 65 69 74 | 68 65 72 20 0d 63 6f 72 |name eit|her .cor|
|00001d70| 72 65 73 70 6f 6e 64 73 | 20 74 6f 20 74 68 65 20 |responds| to the |
|00001d80| 73 75 70 70 6c 69 65 64 | 20 6d 6f 64 65 2c 20 6f |supplied| mode, o|
|00001d90| 72 20 69 73 20 22 75 6e | 64 65 66 69 6e 65 64 20 |r is "un|defined |
|00001da0| 6d 6f 64 65 22 2e 0d 0d | 69 6e 74 20 47 44 56 65 |mode"...|int GDVe|
|00001db0| 72 73 69 6f 6e 28 47 44 | 48 61 6e 64 6c 65 20 64 |rsion(GD|Handle d|
|00001dc0| 65 76 69 63 65 29 0d 52 | 65 74 75 72 6e 73 20 74 |evice).R|eturns t|
|00001dd0| 68 65 20 76 65 72 73 69 | 6f 6e 20 6e 75 6d 62 65 |he versi|on numbe|
|00001de0| 72 20 6f 66 20 74 68 65 | 20 64 72 69 76 65 72 2e |r of the| driver.|
|00001df0| 20 46 72 6f 6d 20 74 68 | 65 20 66 69 72 73 74 20 | From th|e first |
|00001e00| 77 6f 72 64 2d 61 6c 69 | 67 6e 65 64 20 77 6f 72 |word-ali|gned wor|
|00001e10| 64 20 61 66 74 65 72 0d | 74 68 65 20 6e 61 6d 65 |d after.|the name|
|00001e20| 20 73 74 72 69 6e 67 2e | 20 54 68 69 73 20 69 73 | string.| This is|
|00001e30| 20 71 75 69 63 6b 2e 0d | 0d 75 6e 73 69 67 6e 65 | quick..|.unsigne|
|00001e40| 64 20 63 68 61 72 20 2a | 47 44 4e 61 6d 65 28 47 |d char *|GDName(G|
|00001e50| 44 48 61 6e 64 6c 65 20 | 64 65 76 69 63 65 29 3b |DHandle |device);|
|00001e60| 0d 52 65 74 75 72 6e 73 | 20 61 20 70 6f 69 6e 74 |.Returns| a point|
|00001e70| 65 72 20 74 6f 20 74 68 | 65 20 6e 61 6d 65 20 6f |er to th|e name o|
|00001e80| 66 20 74 68 65 20 64 72 | 69 76 65 72 20 28 61 20 |f the dr|iver (a |
|00001e90| 70 61 73 63 61 6c 20 73 | 74 72 69 6e 67 29 2e 20 |pascal s|tring). |
|00001ea0| 54 68 69 73 20 69 73 20 | 71 75 69 63 6b 2e 0d 54 |This is |quick..T|
|00001eb0| 68 65 20 73 74 72 69 6e | 67 20 69 73 20 70 61 72 |he strin|g is par|
|00001ec0| 74 20 6f 66 20 74 68 65 | 20 64 72 69 76 65 72 20 |t of the| driver |
|00001ed0| 69 74 73 65 6c 66 2c 20 | 73 6f 20 64 6f 6e 27 74 |itself, |so don't|
|00001ee0| 20 74 72 79 20 74 6f 20 | 64 69 73 70 6f 73 65 20 | try to |dispose |
|00001ef0| 6f 66 20 69 74 2e 0d 0d | 63 68 61 72 20 2a 47 44 |of it...|char *GD|
|00001f00| 43 61 72 64 4e 61 6d 65 | 28 47 44 48 61 6e 64 6c |CardName|(GDHandl|
|00001f10| 65 20 64 65 76 69 63 65 | 29 3b 0d 52 65 74 75 72 |e device|);.Retur|
|00001f20| 6e 73 20 74 68 65 20 61 | 64 64 72 65 73 73 20 6f |ns the a|ddress o|
|00001f30| 66 20 61 20 43 20 73 74 | 72 69 6e 67 20 63 6f 6e |f a C st|ring con|
|00001f40| 74 61 69 6e 69 6e 67 20 | 74 68 65 20 6e 61 6d 65 |taining |the name|
|00001f50| 20 6f 66 20 74 68 65 20 | 76 69 64 65 6f 20 63 61 | of the |video ca|
|00001f60| 72 64 2e 20 59 6f 75 0d | 73 68 6f 75 6c 64 20 63 |rd. You.|should c|
|00001f70| 61 6c 6c 20 44 69 73 70 | 6f 73 50 74 72 28 29 20 |all Disp|osPtr() |
|00001f80| 6f 6e 20 74 68 65 20 72 | 65 74 75 72 6e 65 64 20 |on the r|eturned |
|00001f90| 73 74 72 69 6e 67 20 77 | 68 65 6e 20 79 6f 75 20 |string w|hen you |
|00001fa0| 6e 6f 20 6c 6f 6e 67 65 | 72 20 6e 65 65 64 20 69 |no longe|r need i|
|00001fb0| 74 2e 0d 54 61 6b 65 73 | 20 61 62 6f 75 74 20 31 |t..Takes| about 1|
|00001fc0| 2e 35 20 6d 73 20 62 65 | 63 61 75 73 65 20 41 70 |.5 ms be|cause Ap|
|00001fd0| 70 6c 65 27 73 20 73 6c | 6f 74 20 72 6f 75 74 69 |ple's sl|ot routi|
|00001fe0| 6e 65 73 20 61 72 65 20 | 76 65 72 79 20 73 6c 6f |nes are |very slo|
|00001ff0| 77 2e 20 0d 0d 4c 45 53 | 53 20 55 53 45 46 55 4c |w. ..LES|S USEFUL|
|00002000| 20 43 41 4c 4c 53 3a 0d | 0d 56 69 64 65 6f 44 72 | CALLS:.|.VideoDr|
|00002010| 69 76 65 72 20 2a 47 44 | 44 72 69 76 65 72 41 64 |iver *GD|DriverAd|
|00002020| 64 72 65 73 73 28 47 44 | 48 61 6e 64 6c 65 20 64 |dress(GD|Handle d|
|00002030| 65 76 69 63 65 29 3b 0d | 52 65 74 75 72 6e 73 20 |evice);.|Returns |
|00002040| 61 20 70 6f 69 6e 74 65 | 72 20 74 6f 20 74 68 65 |a pointe|r to the|
|00002050| 20 64 72 69 76 65 72 2c | 20 77 68 65 74 68 65 72 | driver,| whether|
|00002060| 20 69 6e 20 52 4f 4d 20 | 6f 72 20 52 41 4d 2e 20 | in ROM |or RAM. |
|00002070| 4e 65 69 74 68 65 72 20 | 74 68 69 73 20 70 72 6f |Neither |this pro|
|00002080| 74 6f 74 79 70 65 0d 6e | 6f 72 20 74 68 65 20 64 |totype.n|or the d|
|00002090| 65 66 69 6e 69 74 69 6f | 6e 20 6f 66 20 74 68 65 |efinitio|n of the|
|000020a0| 20 56 69 64 65 6f 44 72 | 69 76 65 72 20 73 74 72 | VideoDr|iver str|
|000020b0| 75 63 74 75 72 65 20 61 | 72 65 20 69 6e 63 6c 75 |ucture a|re inclu|
|000020c0| 64 65 64 20 69 6e 20 56 | 69 64 65 6f 54 6f 6f 6c |ded in V|ideoTool|
|000020d0| 62 6f 78 2e 68 2e 0d 0d | 50 61 74 63 68 4d 61 63 |box.h...|PatchMac|
|000020e0| 49 49 63 69 56 69 64 65 | 6f 44 72 69 76 65 72 28 |IIciVide|oDriver(|
|000020f0| 29 3b 0d 46 69 78 65 73 | 20 61 20 62 75 67 20 69 |);.Fixes| a bug i|
|00002100| 6e 20 74 68 65 20 4d 61 | 63 20 49 49 63 69 20 62 |n the Ma|c IIci b|
|00002110| 75 69 6c 74 2d 69 6e 20 | 76 69 64 65 6f 20 64 72 |uilt-in |video dr|
|00002120| 69 76 65 72 20 74 68 61 | 74 20 77 6f 75 6c 64 20 |iver tha|t would |
|00002130| 63 72 61 73 68 20 47 44 | 47 65 74 45 6e 74 72 69 |crash GD|GetEntri|
|00002140| 65 73 2e 0d 54 68 65 20 | 70 61 74 63 68 20 70 65 |es..The |patch pe|
|00002150| 72 73 69 73 74 73 20 75 | 6e 74 69 6c 20 72 65 62 |rsists u|ntil reb|
|00002160| 6f 6f 74 2e 20 49 74 20 | 69 73 20 75 6e 6c 69 6b |oot. It |is unlik|
|00002170| 65 6c 79 20 74 68 61 74 | 20 79 6f 75 20 77 69 6c |ely that| you wil|
|00002180| 6c 20 6e 65 65 64 20 74 | 6f 20 63 61 6c 6c 20 74 |l need t|o call t|
|00002190| 68 69 73 0d 65 78 70 6c | 69 63 69 74 6c 79 2c 20 |his.expl|icitly, |
|000021a0| 50 61 74 63 68 4d 61 63 | 49 49 63 69 56 69 64 65 |PatchMac|IIciVide|
|000021b0| 6f 44 72 69 76 65 72 28 | 29 20 69 73 20 61 75 74 |oDriver(|) is aut|
|000021c0| 6f 6d 61 74 69 63 61 6c | 6c 79 20 69 6e 76 6f 6b |omatical|ly invok|
|000021d0| 65 64 20 74 68 65 20 66 | 69 72 73 74 20 74 69 6d |ed the f|irst tim|
|000021e0| 65 0d 47 44 47 65 74 45 | 6e 74 72 69 65 73 20 69 |e.GDGetE|ntries i|
|000021f0| 73 20 63 61 6c 6c 65 64 | 2e 20 54 68 65 20 4d 61 |s called|. The Ma|
|00002200| 63 20 49 49 63 69 20 62 | 75 69 6c 74 2d 69 6e 20 |c IIci b|uilt-in |
|00002210| 76 69 64 65 6f 20 64 72 | 69 76 65 72 0d 28 2e 44 |video dr|iver.(.D|
|00002220| 69 73 70 6c 61 79 5f 56 | 69 64 65 6f 5f 41 70 70 |isplay_V|ideo_App|
|00002230| 6c 65 5f 52 42 56 31 20 | 64 72 69 76 65 72 2c 20 |le_RBV1 |driver, |
|00002240| 76 65 72 73 69 6f 6e 20 | 30 29 20 68 61 73 20 61 |version |0) has a|
|00002250| 20 62 75 67 20 74 68 61 | 74 20 63 61 75 73 65 73 | bug tha|t causes|
|00002260| 20 69 74 20 74 6f 20 63 | 72 61 73 68 0d 69 66 20 | it to c|rash.if |
|00002270| 79 6f 75 20 74 72 79 20 | 74 6f 20 64 6f 20 61 20 |you try |to do a |
|00002280| 47 65 74 45 6e 74 72 69 | 65 73 20 53 74 61 74 75 |GetEntri|es Statu|
|00002290| 73 20 72 65 71 75 65 73 | 74 2e 20 50 61 74 63 68 |s reques|t. Patch|
|000022a0| 4d 61 63 49 49 63 69 56 | 69 64 65 6f 44 72 69 76 |MacIIciV|ideoDriv|
|000022b0| 65 72 28 29 20 66 69 6e | 64 73 0d 61 6e 64 20 70 |er() fin|ds.and p|
|000022c0| 61 74 63 68 65 73 20 74 | 68 65 20 63 6f 70 79 20 |atches t|he copy |
|000022d0| 6f 66 20 74 68 65 20 62 | 75 67 67 79 20 64 72 69 |of the b|uggy dri|
|000022e0| 76 65 72 20 72 65 73 69 | 64 69 6e 67 20 69 6e 20 |ver resi|ding in |
|000022f0| 6d 65 6d 6f 72 79 2e 20 | 28 49 66 20 74 68 65 20 |memory. |(If the |
|00002300| 64 72 69 76 65 72 20 69 | 73 0d 52 4f 4d 2d 62 61 |driver i|s.ROM-ba|
|00002310| 73 65 64 20 69 74 20 66 | 69 72 73 74 20 6d 6f 76 |sed it f|irst mov|
|00002320| 65 73 20 69 74 20 74 6f | 20 52 41 4d 2c 20 61 6e |es it to| RAM, an|
|00002330| 64 20 74 68 65 6e 20 70 | 61 74 63 68 65 73 20 74 |d then p|atches t|
|00002340| 68 61 74 2e 29 20 4f 6e | 6c 79 20 74 77 6f 0d 69 |hat.) On|ly two.i|
|00002350| 6e 73 74 72 75 63 74 69 | 6f 6e 73 20 61 72 65 20 |nstructi|ons are |
|00002360| 6d 6f 64 69 66 69 65 64 | 2c 20 74 6f 20 73 61 76 |modified|, to sav|
|00002370| 65 20 26 20 72 65 73 74 | 6f 72 65 20 6d 6f 72 65 |e & rest|ore more|
|00002380| 20 72 65 67 69 73 74 65 | 72 73 2e 20 54 68 69 73 | registe|rs. This|
|00002390| 20 66 69 78 20 70 65 72 | 73 69 73 74 73 0d 6f 6e | fix per|sists.on|
|000023a0| 6c 79 20 75 6e 74 69 6c | 20 74 68 65 20 6e 65 78 |ly until| the nex|
|000023b0| 74 20 72 65 62 6f 6f 74 | 2e 20 49 66 20 74 68 65 |t reboot|. If the|
|000023c0| 20 70 61 74 63 68 20 69 | 73 20 73 75 63 63 65 73 | patch i|s succes|
|000023d0| 73 66 75 6c 6c 79 20 61 | 70 70 6c 69 65 64 20 74 |sfully a|pplied t|
|000023e0| 68 65 20 76 65 72 73 69 | 6f 6e 0d 6e 75 6d 62 65 |he versi|on.numbe|
|000023f0| 72 20 69 73 20 69 6e 63 | 72 65 61 73 65 64 20 62 |r is inc|reased b|
|00002400| 79 20 31 30 30 2e 0d 0d | 4f 53 45 72 72 20 47 44 |y 100...|OSErr GD|
|00002410| 47 65 74 50 61 67 65 42 | 61 73 65 28 47 44 48 61 |GetPageB|ase(GDHa|
|00002420| 6e 64 6c 65 20 64 65 76 | 69 63 65 2c 73 68 6f 72 |ndle dev|ice,shor|
|00002430| 74 20 70 61 67 65 2c 50 | 74 72 20 2a 62 61 73 65 |t page,P|tr *base|
|00002440| 41 64 64 72 50 74 72 29 | 3b 0d 43 61 6c 6c 65 64 |AddrPtr)|;.Called|
|00002450| 20 22 47 65 74 42 61 73 | 65 41 64 64 72 22 20 69 | "GetBas|eAddr" i|
|00002460| 6e 20 44 65 73 69 67 6e | 69 6e 67 20 43 61 72 64 |n Design|ing Card|
|00002470| 73 20 61 6e 64 20 44 72 | 69 76 65 72 73 2c 20 33 |s and Dr|ivers, 3|
|00002480| 72 64 20 45 64 2e 20 59 | 6f 75 20 74 65 6c 6c 20 |rd Ed. Y|ou tell |
|00002490| 69 74 20 77 68 69 63 68 | 0d 70 61 67 65 20 6f 66 |it which|.page of|
|000024a0| 20 76 69 64 65 6f 20 6d | 65 6d 6f 72 79 20 79 6f | video m|emory yo|
|000024b0| 75 27 72 65 20 69 6e 74 | 65 72 65 73 74 65 64 20 |u're int|erested |
|000024c0| 69 6e 20 28 69 6e 20 74 | 68 65 20 63 75 72 72 65 |in (in t|he curre|
|000024d0| 6e 74 20 76 69 64 65 6f | 20 6d 6f 64 65 29 2e 20 |nt video| mode). |
|000024e0| 49 74 20 74 65 6c 6c 73 | 0d 79 6f 75 20 74 68 65 |It tells|.you the|
|000024f0| 20 62 61 73 65 20 61 64 | 64 72 65 73 73 20 6f 66 | base ad|dress of|
|00002500| 20 74 68 61 74 20 70 61 | 67 65 2e 0d 0d 4f 53 45 | that pa|ge...OSE|
|00002510| 72 72 20 47 44 47 65 74 | 50 61 67 65 43 6e 74 28 |rr GDGet|PageCnt(|
|00002520| 47 44 48 61 6e 64 6c 65 | 20 64 65 76 69 63 65 2c |GDHandle| device,|
|00002530| 73 68 6f 72 74 20 6d 6f | 64 65 2c 73 68 6f 72 74 |short mo|de,short|
|00002540| 20 2a 70 61 67 65 73 50 | 74 72 29 3b 0d 43 61 6c | *pagesP|tr);.Cal|
|00002550| 6c 65 64 20 22 47 65 74 | 50 61 67 65 73 22 20 69 |led "Get|Pages" i|
|00002560| 6e 20 44 65 73 69 67 6e | 69 6e 67 20 43 61 72 64 |n Design|ing Card|
|00002570| 73 20 61 6e 64 20 44 72 | 69 76 65 72 73 2c 20 33 |s and Dr|ivers, 3|
|00002580| 72 64 20 45 64 2e 20 59 | 6f 75 20 74 65 6c 6c 20 |rd Ed. Y|ou tell |
|00002590| 69 74 20 77 68 69 63 68 | 20 6d 6f 64 65 0d 79 6f |it which| mode.yo|
|000025a0| 75 27 72 65 20 69 6e 74 | 65 72 65 73 74 65 64 20 |u're int|erested |
|000025b0| 69 6e 2e 20 49 74 20 74 | 65 6c 6c 73 20 79 6f 75 |in. It t|ells you|
|000025c0| 20 68 6f 77 20 6d 61 6e | 79 20 70 61 67 65 73 20 | how man|y pages |
|000025d0| 6f 66 20 76 69 64 65 6f | 20 72 61 6d 20 61 72 65 |of video| ram are|
|000025e0| 20 61 76 61 69 6c 61 62 | 6c 65 20 69 6e 20 0d 74 | availab|le in .t|
|000025f0| 68 61 74 20 6d 6f 64 65 | 2e 0d 0d 4f 53 45 72 72 |hat mode|...OSErr|
|00002600| 20 47 44 47 65 74 47 72 | 61 79 28 47 44 48 61 6e | GDGetGr|ay(GDHan|
|00002610| 64 6c 65 20 64 65 76 69 | 63 65 2c 42 6f 6f 6c 65 |dle devi|ce,Boole|
|00002620| 61 6e 20 2a 66 6c 61 67 | 50 74 72 29 3b 0d 47 65 |an *flag|Ptr);.Ge|
|00002630| 74 20 67 72 61 79 20 66 | 6c 61 67 2e 20 30 20 66 |t gray f|lag. 0 f|
|00002640| 6f 72 20 63 6f 6c 6f 72 | 2e 20 31 20 69 66 20 61 |or color|. 1 if a|
|00002650| 6c 6c 20 63 6f 6c 6f 72 | 73 20 6d 61 70 70 65 64 |ll color|s mapped|
|00002660| 20 74 6f 20 6c 75 6d 69 | 6e 61 6e 63 65 2d 65 71 | to lumi|nance-eq|
|00002670| 75 69 76 61 6c 65 6e 74 | 20 67 72 61 79 20 74 6f |uivalent| gray to|
|00002680| 6e 65 73 2e 0d 0d 4f 53 | 45 72 72 20 47 44 53 65 |nes...OS|Err GDSe|
|00002690| 74 47 72 61 79 28 47 44 | 48 61 6e 64 6c 65 20 64 |tGray(GD|Handle d|
|000026a0| 65 76 69 63 65 2c 42 6f | 6f 6c 65 61 6e 20 66 6c |evice,Bo|olean fl|
|000026b0| 61 67 29 3b 0d 53 65 74 | 20 67 72 61 79 20 66 6c |ag);.Set| gray fl|
|000026c0| 61 67 2e 20 30 20 66 6f | 72 20 63 6f 6c 6f 72 2e |ag. 0 fo|r color.|
|000026d0| 20 31 20 69 66 20 61 6c | 6c 20 63 6f 6c 6f 72 73 | 1 if al|l colors|
|000026e0| 20 6d 61 70 70 65 64 20 | 74 6f 20 6c 75 6d 69 6e | mapped |to lumin|
|000026f0| 61 6e 63 65 2d 65 71 75 | 69 76 61 6c 65 6e 74 20 |ance-equ|ivalent |
|00002700| 67 72 61 79 20 74 6f 6e | 65 73 2e 0d 0d 4f 53 45 |gray ton|es...OSE|
|00002710| 72 72 20 47 44 47 65 74 | 49 6e 74 65 72 72 75 70 |rr GDGet|Interrup|
|00002720| 74 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |t(GDHand|le devic|
|00002730| 65 2c 42 6f 6f 6c 65 61 | 6e 20 2a 66 6c 61 67 50 |e,Boolea|n *flagP|
|00002740| 74 72 29 3b 0d 47 65 74 | 20 66 6c 61 67 2e 20 31 |tr);.Get| flag. 1|
|00002750| 20 69 66 20 56 42 4c 20 | 69 6e 74 65 72 72 75 70 | if VBL |interrup|
|00002760| 74 73 20 6f 66 20 74 68 | 69 73 20 63 61 72 64 20 |ts of th|is card |
|00002770| 61 72 65 20 65 6e 61 62 | 6c 65 64 2e 20 30 20 69 |are enab|led. 0 i|
|00002780| 66 20 64 69 73 61 62 6c | 65 64 2e 20 0d 0d 4f 53 |f disabl|ed. ..OS|
|00002790| 45 72 72 20 47 44 53 65 | 74 49 6e 74 65 72 72 75 |Err GDSe|tInterru|
|000027a0| 70 74 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |pt(GDHan|dle devi|
|000027b0| 63 65 2c 42 6f 6f 6c 65 | 61 6e 20 66 6c 61 67 29 |ce,Boole|an flag)|
|000027c0| 3b 0d 53 65 74 20 66 6c | 61 67 20 74 6f 20 31 20 |;.Set fl|ag to 1 |
|000027d0| 74 6f 20 65 6e 61 62 6c | 65 20 56 42 4c 20 69 6e |to enabl|e VBL in|
|000027e0| 74 65 72 72 75 70 74 73 | 20 6f 66 20 74 68 69 73 |terrupts| of this|
|000027f0| 20 63 61 72 64 2c 20 6f | 72 20 30 20 74 6f 20 64 | card, o|r 0 to d|
|00002800| 69 73 61 62 6c 65 2e 20 | 0d 0d 4f 53 45 72 72 20 |isable. |..OSErr |
|00002810| 47 44 47 65 74 44 65 66 | 61 75 6c 74 4d 6f 64 65 |GDGetDef|aultMode|
|00002820| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00002830| 2c 73 68 6f 72 74 20 2a | 6d 6f 64 65 50 74 72 29 |,short *|modePtr)|
|00002840| 0d 49 74 20 74 65 6c 6c | 73 20 79 6f 75 20 77 68 |.It tell|s you wh|
|00002850| 61 74 20 74 68 65 20 64 | 65 66 61 75 6c 74 20 6d |at the d|efault m|
|00002860| 6f 64 65 20 69 73 2e 20 | 49 27 6d 20 6e 6f 74 20 |ode is. |I'm not |
|00002870| 73 75 72 65 20 77 68 61 | 74 20 74 68 69 73 20 6d |sure wha|t this m|
|00002880| 65 61 6e 73 2e 0d 0d 4f | 53 45 72 72 20 47 44 53 |eans...O|SErr GDS|
|00002890| 65 74 44 65 66 61 75 6c | 74 4d 6f 64 65 28 47 44 |etDefaul|tMode(GD|
|000028a0| 48 61 6e 64 6c 65 20 64 | 65 76 69 63 65 2c 73 68 |Handle d|evice,sh|
|000028b0| 6f 72 74 20 6d 6f 64 65 | 29 3b 0d 53 75 70 70 6f |ort mode|);.Suppo|
|000028c0| 73 65 64 6c 79 2c 20 79 | 6f 75 20 74 65 6c 6c 20 |sedly, y|ou tell |
|000028d0| 69 74 20 77 68 61 74 20 | 6d 6f 64 65 20 79 6f 75 |it what |mode you|
|000028e0| 20 77 61 6e 74 20 74 6f | 20 73 74 61 72 74 20 75 | want to| start u|
|000028f0| 70 20 77 69 74 68 20 77 | 68 65 6e 20 79 6f 75 20 |p with w|hen you |
|00002900| 72 65 62 6f 6f 74 2e 0d | 28 49 27 76 65 20 6e 65 |reboot..|(I've ne|
|00002910| 76 65 72 20 62 65 65 6e | 20 61 62 6c 65 20 74 6f |ver been| able to|
|00002920| 20 67 65 74 20 74 68 69 | 73 20 74 6f 20 77 6f 72 | get thi|s to wor|
|00002930| 6b 2e 20 4e 6f 20 65 72 | 72 6f 72 20 61 6e 64 20 |k. No er|ror and |
|00002940| 6e 6f 20 65 66 66 65 63 | 74 2e 20 50 65 72 68 61 |no effec|t. Perha|
|00002950| 70 73 20 49 27 76 65 0d | 6d 69 73 75 6e 64 65 72 |ps I've.|misunder|
|00002960| 73 74 6f 6f 64 20 69 74 | 73 20 70 75 72 70 6f 73 |stood it|s purpos|
|00002970| 65 2e 29 0d 0d 4f 53 45 | 72 72 20 47 44 47 72 61 |e.)..OSE|rr GDGra|
|00002980| 79 50 61 67 65 28 47 44 | 48 61 6e 64 6c 65 20 64 |yPage(GD|Handle d|
|00002990| 65 76 69 63 65 2c 73 68 | 6f 72 74 20 70 61 67 65 |evice,sh|ort page|
|000029a0| 29 3b 0d 43 61 6c 6c 65 | 64 20 22 47 72 61 79 53 |);.Calle|d "GrayS|
|000029b0| 63 72 65 65 6e 22 20 69 | 6e 20 44 65 73 69 67 6e |creen" i|n Design|
|000029c0| 69 6e 67 20 43 61 72 64 | 73 20 61 6e 64 20 44 72 |ing Card|s and Dr|
|000029d0| 69 76 65 72 73 2c 20 33 | 72 64 20 45 64 2e 20 46 |ivers, 3|rd Ed. F|
|000029e0| 69 6c 6c 73 20 74 68 65 | 20 73 70 65 63 69 66 69 |ills the| specifi|
|000029f0| 65 64 0d 70 61 67 65 20 | 77 69 74 68 20 67 72 61 |ed.page |with gra|
|00002a00| 79 2c 20 69 2e 65 2e 20 | 74 68 65 20 64 69 74 68 |y, i.e. |the dith|
|00002a10| 65 72 65 64 20 64 65 73 | 6b 74 6f 70 20 70 61 74 |ered des|ktop pat|
|00002a20| 74 65 72 6e 2e 20 49 27 | 6d 20 6e 6f 74 20 61 77 |tern. I'|m not aw|
|00002a30| 61 72 65 20 6f 66 20 61 | 6e 79 0d 70 61 72 74 69 |are of a|ny.parti|
|00002a40| 63 75 6c 61 72 20 61 64 | 76 61 6e 74 61 67 65 20 |cular ad|vantage |
|00002a50| 69 6e 20 75 73 69 6e 67 | 20 74 68 69 73 20 69 6e |in using| this in|
|00002a60| 73 74 65 61 64 20 6f 66 | 20 46 69 6c 6c 52 65 63 |stead of| FillRec|
|00002a70| 74 28 29 2e 20 44 65 73 | 69 67 6e 69 6e 67 20 43 |t(). Des|igning C|
|00002a80| 61 72 64 73 20 61 6e 64 | 0d 44 72 69 76 65 72 73 |ards and|.Drivers|
|00002a90| 2c 20 33 72 64 20 45 64 | 69 74 69 6f 6e 2c 20 43 |, 3rd Ed|ition, C|
|00002aa0| 68 61 70 74 65 72 20 39 | 2c 20 73 61 79 73 20 74 |hapter 9|, says t|
|00002ab0| 68 61 74 20 66 6f 72 20 | 64 69 72 65 63 74 20 64 |hat for |direct d|
|00002ac0| 65 76 69 63 65 73 2c 20 | 69 2e 65 2e 20 3e 38 20 |evices, |i.e. >8 |
|00002ad0| 62 69 74 0d 70 69 78 65 | 6c 73 2c 20 74 68 65 20 |bit.pixe|ls, the |
|00002ae0| 64 72 69 76 65 72 20 77 | 69 6c 6c 20 61 6c 73 6f |driver w|ill also|
|00002af0| 20 6c 6f 61 64 20 61 20 | 6c 69 6e 65 61 72 2c 20 | load a |linear, |
|00002b00| 67 61 6d 6d 61 2d 63 6f | 72 72 65 63 74 65 64 2c |gamma-co|rrected,|
|00002b10| 20 67 72 61 79 20 63 6f | 6c 6f 72 20 74 61 62 6c | gray co|lor tabl|
|00002b20| 65 2e 0d 0d 4f 53 45 72 | 72 20 47 44 52 65 73 65 |e...OSEr|r GDRese|
|00002b30| 74 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |t(GDHand|le devic|
|00002b40| 65 2c 20 73 68 6f 72 74 | 20 2a 6d 6f 64 65 50 74 |e, short| *modePt|
|00002b50| 72 2c 20 73 68 6f 72 74 | 20 2a 70 61 67 65 50 74 |r, short| *pagePt|
|00002b60| 72 2c 20 50 74 72 20 2a | 62 61 73 65 41 64 64 72 |r, Ptr *|baseAddr|
|00002b70| 50 74 72 29 3b 0d 49 6e | 69 74 69 61 6c 69 7a 65 |Ptr);.In|itialize|
|00002b80| 20 74 68 65 20 76 69 64 | 65 6f 20 63 61 72 64 20 | the vid|eo card |
|00002b90| 74 6f 20 69 74 73 20 73 | 74 61 72 74 75 70 20 73 |to its s|tartup s|
|00002ba0| 74 61 74 65 2c 20 75 73 | 75 61 6c 6c 79 20 31 20 |tate, us|ually 1 |
|00002bb0| 62 69 74 20 70 65 72 20 | 70 69 78 65 6c 2e 20 52 |bit per |pixel. R|
|00002bc0| 65 74 75 72 6e 73 0d 74 | 68 65 20 70 61 72 61 6d |eturns.t|he param|
|00002bd0| 65 74 65 72 73 20 6f 66 | 20 74 68 61 74 20 73 74 |eters of| that st|
|00002be0| 61 74 65 2e 0d 0d 4f 53 | 45 72 72 20 47 44 43 6f |ate...OS|Err GDCo|
|00002bf0| 6e 74 72 6f 6c 28 69 6e | 74 20 72 65 66 4e 75 6d |ntrol(in|t refNum|
|00002c00| 2c 69 6e 74 20 63 73 43 | 6f 64 65 2c 50 74 72 20 |,int csC|ode,Ptr |
|00002c10| 63 73 50 61 72 61 6d 50 | 74 72 29 0d 55 73 65 73 |csParamP|tr).Uses|
|00002c20| 20 6c 6f 77 2d 6c 65 76 | 65 6c 20 50 42 43 6f 6e | low-lev|el PBCon|
|00002c30| 74 72 6f 6c 28 29 20 63 | 61 6c 6c 20 74 6f 20 69 |trol() c|all to i|
|00002c40| 6d 70 6c 65 6d 65 6e 74 | 20 61 20 22 43 6f 6e 74 |mplement| a "Cont|
|00002c50| 72 6f 6c 28 29 22 20 63 | 61 6c 6c 20 74 68 61 74 |rol()" c|all that|
|00002c60| 20 77 6f 72 6b 73 21 20 | 0d 49 20 64 6f 6e 27 74 | works! |.I don't|
|00002c70| 20 6b 6e 6f 77 20 77 68 | 79 20 74 68 69 73 20 77 | know wh|y this w|
|00002c80| 61 73 6e 27 74 20 64 69 | 73 63 75 73 73 65 64 20 |asn't di|scussed |
|00002c90| 69 6e 20 41 70 70 6c 65 | 20 54 65 63 68 20 4e 6f |in Apple| Tech No|
|00002ca0| 74 65 20 32 36 32 2e 0d | 0d 4f 53 45 72 72 20 47 |te 262..|.OSErr G|
|00002cb0| 44 53 74 61 74 75 73 28 | 69 6e 74 20 72 65 66 4e |DStatus(|int refN|
|00002cc0| 75 6d 2c 69 6e 74 20 63 | 73 43 6f 64 65 2c 50 74 |um,int c|sCode,Pt|
|00002cd0| 72 20 63 73 50 61 72 61 | 6d 50 74 72 29 0d 55 73 |r csPara|mPtr).Us|
|00002ce0| 65 73 20 6c 6f 77 2d 6c | 65 76 65 6c 20 50 42 53 |es low-l|evel PBS|
|00002cf0| 74 61 74 75 73 28 29 20 | 63 61 6c 6c 20 74 6f 20 |tatus() |call to |
|00002d00| 69 6d 70 6c 65 6d 65 6e | 74 20 61 20 22 53 74 61 |implemen|t a "Sta|
|00002d10| 74 75 73 28 29 22 20 63 | 61 6c 6c 20 74 68 61 74 |tus()" c|all that|
|00002d20| 20 77 6f 72 6b 73 21 20 | 54 68 65 0d 6e 65 65 64 | works! |The.need|
|00002d30| 20 66 6f 72 20 74 68 69 | 73 20 69 73 20 65 78 70 | for thi|s is exp|
|00002d40| 6c 61 69 6e 65 64 20 69 | 6e 20 41 70 70 6c 65 20 |lained i|n Apple |
|00002d50| 54 65 63 68 20 4e 6f 74 | 65 20 32 36 32 2c 20 77 |Tech Not|e 262, w|
|00002d60| 68 69 63 68 20 77 61 73 | 20 69 73 73 75 65 64 20 |hich was| issued |
|00002d70| 69 6e 20 72 65 73 70 6f | 6e 73 65 0d 74 6f 20 6d |in respo|nse.to m|
|00002d80| 79 20 62 75 67 20 72 65 | 70 6f 72 74 20 69 6e 20 |y bug re|port in |
|00002d90| 73 75 6d 6d 65 72 20 6f | 66 20 27 38 39 2e 0d 0d |summer o|f '89...|
|00002da0| 4e 4f 54 45 53 3a 0d 0d | 53 65 76 65 72 61 6c 20 |NOTES:..|Several |
|00002db0| 62 75 67 73 20 69 6e 20 | 76 65 72 73 69 6f 6e 20 |bugs in |version |
|00002dc0| 32 20 28 69 6e 20 53 79 | 73 74 65 6d 20 b2 36 2e |2 (in Sy|stem .6.|
|00002dd0| 30 33 29 20 6f 66 20 74 | 68 65 20 76 69 64 65 6f |03) of t|he video|
|00002de0| 20 64 72 69 76 65 72 20 | 66 6f 72 20 41 70 70 6c | driver |for Appl|
|00002df0| 65 27 73 0d 22 54 6f 62 | 79 20 46 72 61 6d 65 20 |e's."Tob|y Frame |
|00002e00| 42 75 66 66 65 72 22 20 | 76 69 64 65 6f 20 63 61 |Buffer" |video ca|
|00002e10| 72 64 20 74 68 61 74 20 | 61 66 66 65 63 74 65 64 |rd that |affected|
|00002e20| 20 75 73 65 20 6f 66 20 | 74 68 65 20 47 65 74 47 | use of |the GetG|
|00002e30| 61 6d 6d 61 20 63 61 6c | 6c 20 77 65 72 65 0d 66 |amma cal|l were.f|
|00002e40| 69 78 65 64 20 69 6e 20 | 76 65 72 73 69 6f 6e 20 |ixed in |version |
|00002e50| 33 20 28 69 6e 20 53 79 | 73 74 65 6d 20 36 2e 30 |3 (in Sy|stem 6.0|
|00002e60| 34 29 2c 20 61 70 70 61 | 72 65 6e 74 6c 79 20 69 |4), appa|rently i|
|00002e70| 6e 20 72 65 73 70 6f 6e | 73 65 20 74 6f 20 6d 79 |n respon|se to my|
|00002e80| 20 62 75 67 20 72 65 70 | 6f 72 74 20 74 6f 0d 41 | bug rep|ort to.A|
|00002e90| 70 70 6c 65 2e 0d 0d 54 | 68 65 20 63 6f 6e 74 72 |pple...T|he contr|
|00002ea0| 6f 6c 2f 73 74 61 74 75 | 73 2d 63 61 6c 6c 20 70 |ol/statu|s-call p|
|00002eb0| 61 72 61 6d 65 74 65 72 | 20 69 6e 20 61 20 47 44 |arameter| in a GD|
|00002ec0| 43 6f 6e 74 72 6f 6c 20 | 6f 72 20 47 44 53 74 61 |Control |or GDSta|
|00002ed0| 74 75 73 20 63 61 6c 6c | 20 73 70 65 63 69 66 69 |tus call| specifi|
|00002ee0| 65 73 20 77 68 61 74 0d | 79 6f 75 20 77 61 6e 74 |es what.|you want|
|00002ef0| 20 64 6f 6e 65 2e 20 53 | 65 65 20 44 65 73 69 67 | done. S|ee Desig|
|00002f00| 6e 69 6e 67 20 43 61 72 | 64 73 20 61 6e 64 20 44 |ning Car|ds and D|
|00002f10| 72 69 76 65 72 73 2c 20 | 33 72 64 20 45 64 69 74 |rivers, |3rd Edit|
|00002f20| 69 6f 6e 2c 20 43 68 61 | 70 74 65 72 20 39 2e 20 |ion, Cha|pter 9. |
|00002f30| 4e 6f 74 65 0d 74 68 61 | 74 20 73 6f 6d 65 74 69 |Note.tha|t someti|
|00002f40| 6d 65 20 61 72 6f 75 6e | 64 20 31 39 39 30 20 41 |me aroun|d 1990 A|
|00002f50| 70 70 6c 65 20 72 65 6e | 61 6d 65 64 20 73 6f 6d |pple ren|amed som|
|00002f60| 65 20 6f 66 20 74 68 65 | 20 43 6f 6e 74 72 6f 6c |e of the| Control|
|00002f70| 20 61 6e 64 20 53 74 61 | 74 75 73 20 63 61 6c 6c | and Sta|tus call|
|00002f80| 73 2c 0d 67 69 76 69 6e | 67 20 74 68 65 6d 20 6e |s,.givin|g them n|
|00002f90| 61 6d 65 73 20 74 68 61 | 74 20 62 65 74 74 65 72 |ames tha|t better|
|00002fa0| 20 72 65 66 6c 65 63 74 | 20 74 68 65 69 72 20 66 | reflect| their f|
|00002fb0| 75 6e 63 74 69 6f 6e 2e | 20 49 20 66 6f 6c 6c 6f |unction.| I follo|
|00002fc0| 77 65 64 20 73 75 69 74 | 2e 20 48 6f 77 65 76 65 |wed suit|. Howeve|
|00002fd0| 72 2c 0d 41 70 70 6c 65 | 20 6e 65 67 6c 65 63 74 |r,.Apple| neglect|
|00002fe0| 65 64 20 74 6f 20 75 70 | 64 61 74 65 20 74 68 65 |ed to up|date the|
|00002ff0| 69 72 20 62 6f 6f 6b 2c | 20 44 65 73 69 67 6e 69 |ir book,| Designi|
|00003000| 6e 67 20 43 61 72 64 73 | 20 61 6e 64 20 44 72 69 |ng Cards| and Dri|
|00003010| 76 65 72 73 2c 20 6e 6f | 77 20 69 6e 20 69 74 73 |vers, no|w in its|
|00003020| 0d 33 72 64 20 65 64 69 | 74 69 6f 6e 2e 20 46 6f |.3rd edi|tion. Fo|
|00003030| 72 74 75 6e 61 74 65 6c | 79 2c 20 74 68 65 79 20 |rtunatel|y, they |
|00003040| 64 65 66 69 6e 65 20 62 | 6f 74 68 20 6e 61 6d 65 |define b|oth name|
|00003050| 73 20 69 6e 20 74 68 65 | 69 72 20 56 69 64 65 6f |s in the|ir Video|
|00003060| 2e 68 20 68 65 61 64 65 | 72 20 66 69 6c 65 2e 0d |.h heade|r file..|
|00003070| 54 6f 20 61 76 6f 69 64 | 20 63 6f 6e 66 75 73 69 |To avoid| confusi|
|00003080| 6f 6e 2c 20 68 65 72 65 | 20 61 72 65 20 74 68 65 |on, here| are the|
|00003090| 20 65 71 75 69 76 61 6c | 65 6e 63 65 73 2e 20 4e | equival|ences. N|
|000030a0| 6f 74 65 20 74 68 61 74 | 20 22 63 73 63 22 20 73 |ote that| "csc" s|
|000030b0| 74 61 6e 64 73 20 66 6f | 72 20 0d 22 43 6f 6e 74 |tands fo|r ."Cont|
|000030c0| 72 6f 6c 20 61 6e 64 20 | 53 74 61 74 75 73 20 43 |rol and |Status C|
|000030d0| 61 6c 6c 22 0d 43 6f 6e | 74 72 6f 6c 20 63 61 6c |all".Con|trol cal|
|000030e0| 6c 3a 0d 20 63 73 63 47 | 72 61 79 50 61 67 65 20 |l:. cscG|rayPage |
|000030f0| 3d 20 20 63 73 63 47 72 | 61 79 53 63 72 65 65 6e |= cscGr|ayScreen|
|00003100| 20 3d 20 35 0d 53 74 61 | 74 75 73 20 63 61 6c 6c | = 5.Sta|tus call|
|00003110| 73 3a 0d 20 63 73 63 47 | 65 74 50 61 67 65 43 6e |s:. cscG|etPageCn|
|00003120| 74 20 3d 20 63 73 63 47 | 65 74 50 61 67 65 73 20 |t = cscG|etPages |
|00003130| 3d 20 34 0d 20 63 73 63 | 47 65 74 50 61 67 65 42 |= 4. csc|GetPageB|
|00003140| 61 73 65 20 3d 20 63 73 | 63 47 65 74 42 61 73 65 |ase = cs|cGetBase|
|00003150| 41 64 64 72 20 3d 20 35 | 0d 0d 42 61 73 65 64 20 |Addr = 5|..Based |
|00003160| 6f 6e 3a 0d 49 6e 73 69 | 64 65 20 4d 61 63 69 6e |on:.Insi|de Macin|
|00003170| 74 6f 73 68 2d 49 49 20 | 28 44 65 76 69 63 65 20 |tosh-II |(Device |
|00003180| 4d 61 6e 61 67 65 72 29 | 0d 44 65 73 69 67 6e 69 |Manager)|.Designi|
|00003190| 6e 67 20 43 61 72 64 73 | 20 61 6e 64 20 44 72 69 |ng Cards| and Dri|
|000031a0| 76 65 72 73 2c 20 33 72 | 64 20 45 64 69 74 69 6f |vers, 3r|d Editio|
|000031b0| 6e 2c 20 43 68 61 70 74 | 65 72 20 39 2e 0d 54 65 |n, Chapt|er 9..Te|
|000031c0| 63 68 20 4e 6f 74 65 20 | 32 36 32 3a 20 22 43 6f |ch Note |262: "Co|
|000031d0| 6e 74 72 6f 6c 6c 69 6e | 67 20 53 74 61 74 75 73 |ntrollin|g Status|
|000031e0| 20 43 61 6c 6c 73 22 0d | 22 47 72 65 79 53 63 61 | Calls".|"GreySca|
|000031f0| 6c 65 20 49 6e 66 6f 72 | 6d 61 74 69 6f 6e 22 20 |le Infor|mation" |
|00003200| 66 72 6f 6d 20 41 70 70 | 6c 65 4c 69 6e 6b 20 22 |from App|leLink "|
|00003210| 41 70 70 6c 65 20 54 65 | 63 68 6e 69 63 61 6c 20 |Apple Te|chnical |
|00003220| 49 6e 66 6f 22 0d 22 56 | 69 64 65 6f 20 43 6f 6e |Info"."V|ideo Con|
|00003230| 66 69 67 75 72 61 74 69 | 6f 6e 20 52 4f 4d 20 53 |figurati|on ROM S|
|00003240| 6f 66 74 77 61 72 65 20 | 53 70 65 63 69 66 69 63 |oftware |Specific|
|00003250| 61 74 69 6f 6e 22 20 61 | 6c 73 6f 20 66 72 6f 6d |ation" a|lso from|
|00003260| 20 41 70 70 6c 65 4c 69 | 6e 6b 2c 0d 69 6e 20 22 | AppleLi|nk,.in "|
|00003270| 44 65 76 65 6c 6f 70 65 | 72 20 54 65 63 68 20 53 |Develope|r Tech S|
|00003280| 75 70 70 6f 72 74 3a 4d | 61 63 69 6e 74 6f 73 68 |upport:M|acintosh|
|00003290| 3a 33 32 20 42 69 74 20 | 51 75 69 63 6b 44 72 61 |:32 Bit |QuickDra|
|000032a0| 77 22 0d 0d 48 49 53 54 | 4f 52 59 3a 0d 39 2f 32 |w"..HIST|ORY:.9/2|
|000032b0| 39 2f 38 39 20 09 64 67 | 70 09 61 64 64 65 64 20 |9/89 .dg|p.added |
|000032c0| 63 61 75 74 69 6f 6e 20 | 61 62 6f 76 65 20 74 68 |caution |above th|
|000032d0| 61 74 20 73 75 63 63 65 | 73 73 69 76 65 20 63 61 |at succe|ssive ca|
|000032e0| 6c 6c 73 20 74 6f 20 53 | 65 74 45 6e 74 72 69 65 |lls to S|etEntrie|
|000032f0| 73 20 6d 61 79 20 62 65 | 20 6f 6e 20 6f 6e 65 20 |s may be| on one |
|00003300| 0d 09 09 09 09 66 72 61 | 6d 65 2e 0d 31 31 2f 32 |.....fra|me..11/2|
|00003310| 31 2f 38 39 09 64 67 70 | 09 63 6f 72 72 65 63 74 |1/89.dgp|.correct|
|00003320| 65 64 20 6d 6f 64 65 20 | 6c 69 73 74 3a 20 30 78 |ed mode |list: 0x|
|00003330| 38 30 2e 2e 2e 20 61 73 | 20 70 6f 69 6e 74 65 64 |80... as| pointed|
|00003340| 20 6f 75 74 20 62 79 20 | 43 68 75 63 6b 20 53 74 | out by |Chuck St|
|00003350| 65 69 6e 0d 31 31 2f 33 | 30 2f 38 39 09 64 67 70 |ein.11/3|0/89.dgp|
|00003360| 09 61 64 64 65 64 20 6e | 6f 74 65 20 61 62 6f 76 |.added n|ote abov|
|00003370| 65 20 66 72 6f 6d 20 44 | 6f 6e 20 4b 65 6c 6c 79 |e from D|on Kelly|
|00003380| 2e 0d 09 09 09 09 41 64 | 64 65 64 20 63 61 75 74 |......Ad|ded caut|
|00003390| 69 6f 6e 61 72 79 20 6e | 6f 74 65 20 61 62 6f 76 |ionary n|ote abov|
|000033a0| 65 20 61 62 6f 75 74 20 | 47 44 53 65 74 45 6e 74 |e about |GDSetEnt|
|000033b0| 72 69 65 73 28 29 2e 0d | 33 2f 31 2f 39 30 09 09 |ries()..|3/1/90..|
|000033c0| 64 67 70 09 75 70 64 61 | 74 65 64 20 63 6f 6d 6d |dgp.upda|ted comm|
|000033d0| 65 6e 74 73 2e 0d 33 2f | 33 2f 39 30 09 09 64 67 |ents..3/|3/90..dg|
|000033e0| 70 09 69 6e 63 6c 75 64 | 65 64 20 56 69 64 65 6f |p.includ|ed Video|
|000033f0| 2e 68 20 69 6e 73 74 65 | 61 64 20 6f 66 20 64 65 |.h inste|ad of de|
|00003400| 66 69 6e 69 6e 67 20 56 | 44 53 65 74 45 6e 74 72 |fining V|DSetEntr|
|00003410| 79 52 65 63 6f 72 64 20 | 61 6e 64 20 56 44 50 61 |yRecord |and VDPa|
|00003420| 67 65 49 6e 66 6f 2e 0d | 33 2f 32 30 2f 39 30 09 |geInfo..|3/20/90.|
|00003430| 09 64 67 70 09 6d 61 64 | 65 20 63 6f 6d 70 61 74 |.dgp.mad|e compat|
|00003440| 69 62 6c 65 20 77 69 74 | 68 20 4d 50 57 20 43 2e |ible wit|h MPW C.|
|00003450| 0d 33 2f 32 33 2f 39 30 | 09 09 64 67 70 09 63 68 |.3/23/90|..dgp.ch|
|00003460| 61 6e 67 65 64 20 63 68 | 61 72 20 74 6f 20 75 6e |anged ch|ar to un|
|00003470| 73 69 67 6e 65 64 20 63 | 68 61 72 20 69 6e 20 56 |signed c|har in V|
|00003480| 44 44 65 66 4d 6f 64 65 | 52 65 63 0d 09 09 09 09 |DDefMode|Rec.....|
|00003490| 61 6e 64 20 56 44 46 6c | 61 67 52 65 63 20 74 6f |and VDFl|agRec to|
|000034a0| 20 70 72 65 76 65 6e 74 | 20 75 6e 64 65 73 69 72 | prevent| undesir|
|000034b0| 61 62 6c 65 20 73 69 67 | 6e 20 65 78 74 65 6e 73 |able sig|n extens|
|000034c0| 69 6f 6e 2e 0d 34 2f 32 | 2f 39 30 09 09 64 67 70 |ion..4/2|/90..dgp|
|000034d0| 09 44 65 6c 65 74 65 64 | 20 6d 6f 64 65 20 61 72 |.Deleted| mode ar|
|000034e0| 67 75 6d 65 6e 74 20 66 | 72 6f 6d 20 47 44 47 72 |gument f|rom GDGr|
|000034f0| 61 79 53 63 72 65 65 6e | 28 29 2e 0d 37 2f 32 38 |ayScreen|()..7/28|
|00003500| 2f 39 30 09 09 64 67 70 | 20 46 69 78 65 64 20 73 |/90..dgp| Fixed s|
|00003510| 74 61 63 6b 20 6f 76 65 | 72 66 6c 6f 77 20 69 6e |tack ove|rflow in|
|00003520| 20 47 44 47 72 61 79 53 | 63 72 65 65 6e 2c 20 62 | GDGrayS|creen, b|
|00003530| 79 20 64 65 63 6c 61 72 | 69 6e 67 20 53 79 73 45 |y declar|ing SysE|
|00003540| 6e 76 52 65 63 20 73 74 | 61 74 69 63 2e 0d 31 30 |nvRec st|atic..10|
|00003550| 2f 32 30 2f 39 30 09 64 | 67 70 09 41 70 70 6c 65 |/20/90.d|gp.Apple|
|00003560| 20 68 61 73 20 72 65 6e | 61 6d 65 64 20 74 68 65 | has ren|amed the|
|00003570| 20 63 6f 6e 74 72 6f 6c | 20 61 6e 64 20 73 74 61 | control| and sta|
|00003580| 74 75 73 20 63 61 6c 6c | 73 2c 20 73 6f 20 49 20 |tus call|s, so I |
|00003590| 66 6f 6c 6c 6f 77 65 64 | 20 73 75 69 74 3a 0d 09 |followed| suit:..|
|000035a0| 09 09 09 a5 47 44 47 65 | 74 50 61 67 65 42 61 73 |....GDGe|tPageBas|
|000035b0| 65 20 72 65 70 6c 61 63 | 65 73 20 47 44 47 65 74 |e replac|es GDGet|
|000035c0| 42 61 73 65 41 64 64 72 | 0d 09 09 09 09 a5 47 44 |BaseAddr|......GD|
|000035d0| 52 65 73 65 74 20 72 65 | 70 6c 61 63 65 73 20 47 |Reset re|places G|
|000035e0| 44 49 6e 69 74 0d 09 09 | 09 09 a5 47 44 47 72 61 |DInit...|...GDGra|
|000035f0| 79 50 61 67 65 20 72 65 | 70 6c 61 63 65 20 47 44 |yPage re|place GD|
|00003600| 47 72 61 79 53 63 72 65 | 65 6e 0d 09 09 09 09 a5 |GrayScre|en......|
|00003610| 47 44 47 65 74 50 61 67 | 65 43 6e 74 20 72 65 70 |GDGetPag|eCnt rep|
|00003620| 6c 61 63 65 73 20 47 44 | 47 65 74 50 61 67 65 73 |laces GD|GetPages|
|00003630| 0d 32 2f 31 32 2f 39 31 | 09 09 64 67 70 20 44 69 |.2/12/91|..dgp Di|
|00003640| 73 63 6f 76 65 72 65 64 | 20 74 68 61 74 20 74 68 |scovered| that th|
|00003650| 65 20 6f 6c 64 20 62 75 | 67 20 69 6e 20 47 44 47 |e old bu|g in GDG|
|00003660| 72 61 79 50 61 67 65 20 | 69 73 20 73 74 69 6c 6c |rayPage |is still|
|00003670| 20 70 72 65 73 65 6e 74 | 20 69 6e 20 53 79 73 74 | present| in Syst|
|00003680| 65 6d 0d 09 09 09 09 36 | 2e 30 35 2c 20 73 6f 20 |em.....6|.05, so |
|00003690| 49 20 72 65 6d 6f 76 65 | 64 20 74 68 65 20 63 6f |I remove|d the co|
|000036a0| 6e 64 69 74 69 6f 6e 61 | 6c 20 61 72 6f 75 6e 64 |nditiona|l around|
|000036b0| 20 74 68 65 20 62 75 67 | 20 66 69 78 2e 20 54 65 | the bug| fix. Te|
|000036c0| 73 74 47 44 56 69 64 65 | 6f 0d 09 09 09 09 6e 6f |stGDVide|o.....no|
|000036d0| 77 20 77 6f 72 6b 73 20 | 77 69 74 68 3a 20 4d 61 |w works |with: Ma|
|000036e0| 63 20 49 49 20 56 69 64 | 65 6f 20 43 61 72 64 2c |c II Vid|eo Card,|
|000036f0| 20 4d 61 63 20 49 49 20 | 44 69 73 70 6c 61 79 20 | Mac II |Display |
|00003700| 43 61 72 64 20 28 34 a5 | 38 29 2c 20 0d 09 09 09 |Card (4.|8), ....|
|00003710| 09 4d 61 63 20 49 49 63 | 69 20 42 75 69 6c 74 2d |.Mac IIc|i Built-|
|00003720| 69 6e 20 56 69 64 65 6f | 2c 20 54 72 75 65 56 69 |in Video|, TrueVi|
|00003730| 73 69 6f 6e 20 4e 75 56 | 69 73 74 61 2c 20 4d 61 |sion NuV|ista, Ma|
|00003740| 63 20 49 49 73 69 20 42 | 75 69 6c 74 2d 69 6e 20 |c IIsi B|uilt-in |
|00003750| 56 69 64 65 6f 2e 0d 37 | 2f 32 32 2f 39 31 09 09 |Video..7|/22/91..|
|00003760| 64 67 70 09 43 68 61 6e | 67 65 64 20 64 65 66 69 |dgp.Chan|ged defi|
|00003770| 6e 69 74 69 6f 6e 20 6f | 66 20 63 73 47 54 61 62 |nition o|f csGTab|
|00003780| 6c 65 20 66 72 6f 6d 20 | 47 61 6d 6d 61 54 62 6c |le from |GammaTbl|
|00003790| 50 74 72 20 74 6f 20 50 | 74 72 2c 20 0d 09 09 09 |Ptr to P|tr, ....|
|000037a0| 09 74 6f 20 63 6f 6e 66 | 6f 72 6d 20 77 69 74 68 |.to conf|orm with|
|000037b0| 20 4d 50 57 20 43 2e 0d | 38 2f 32 34 2f 39 31 09 | MPW C..|8/24/91.|
|000037c0| 09 64 67 70 09 4d 61 64 | 65 20 63 6f 6d 70 61 74 |.dgp.Mad|e compat|
|000037d0| 69 62 6c 65 20 77 69 74 | 68 20 54 48 49 4e 4b 20 |ible wit|h THINK |
|000037e0| 43 20 35 2e 30 2e 0d 31 | 30 2f 32 32 2f 39 31 09 |C 5.0..1|0/22/91.|
|000037f0| 64 67 70 09 57 69 74 68 | 20 68 65 6c 70 20 66 72 |dgp.With| help fr|
|00003800| 6f 6d 20 42 61 72 74 20 | 46 61 72 65 6c 6c 2c 20 |om Bart |Farell, |
|00003810| 63 6f 6e 76 65 72 74 65 | 64 20 61 6c 6c 20 66 75 |converte|d all fu|
|00003820| 6e 63 74 69 6f 6e 73 20 | 68 65 61 64 65 72 73 20 |nctions |headers |
|00003830| 74 6f 0d 09 09 09 09 41 | 4e 53 49 20 73 74 79 6c |to.....A|NSI styl|
|00003840| 65 2e 0d 38 2f 32 36 2f | 39 32 09 09 64 67 70 09 |e..8/26/|92..dgp.|
|00003850| 61 64 64 65 64 20 61 20 | 66 65 77 20 6d 69 73 63 |added a |few misc|
|00003860| 65 6c 6c 61 6e 65 6f 75 | 73 20 63 6f 6d 6d 65 6e |ellaneou|s commen|
|00003870| 74 73 0d 09 09 09 09 49 | 6e 20 61 6c 6c 20 72 6f |ts.....I|n all ro|
|00003880| 75 74 69 6e 65 73 2c 20 | 2a 62 61 73 65 41 64 64 |utines, |*baseAdd|
|00003890| 72 50 74 72 20 69 73 20 | 6e 6f 77 20 73 65 74 20 |rPtr is |now set |
|000038a0| 6f 6e 6c 79 20 69 66 20 | 62 61 73 65 41 64 64 72 |only if |baseAddr|
|000038b0| 50 74 72 20 69 73 20 6e | 6f 74 20 4e 55 4c 4c 2e |Ptr is n|ot NULL.|
|000038c0| 0d 31 30 2f 31 30 2f 39 | 32 09 64 67 70 09 41 64 |.10/10/9|2.dgp.Ad|
|000038d0| 64 65 64 20 47 44 52 65 | 73 74 6f 72 65 44 65 76 |ded GDRe|storeDev|
|000038e0| 69 63 65 43 6c 75 74 28 | 29 2e 20 52 65 6d 6f 76 |iceClut(|). Remov|
|000038f0| 65 64 20 6f 62 73 6f 6c | 65 74 65 20 73 75 70 70 |ed obsol|ete supp|
|00003900| 6f 72 74 20 66 6f 72 20 | 54 48 49 4e 4b 20 43 20 |ort for |THINK C |
|00003910| 34 2e 0d 31 31 2f 33 30 | 2f 39 32 09 64 67 70 20 |4..11/30|/92.dgp |
|00003920| 63 6f 72 72 65 63 74 65 | 64 20 65 72 72 6f 72 20 |correcte|d error |
|00003930| 69 6e 20 63 6f 6d 6d 65 | 6e 74 20 64 6f 63 75 6d |in comme|nt docum|
|00003940| 65 6e 74 69 6e 67 20 76 | 61 6c 75 65 73 20 6f 66 |enting v|alues of|
|00003950| 20 61 72 67 75 6d 65 6e | 74 20 74 6f 20 47 44 53 | argumen|t to GDS|
|00003960| 65 74 47 72 61 79 28 29 | 2e 0d 09 09 09 09 53 65 |etGray()|......Se|
|00003970| 74 20 66 6c 61 67 20 74 | 6f 20 7a 65 72 6f 20 66 |t flag t|o zero f|
|00003980| 6f 72 20 63 6f 6c 6f 72 | 2c 31 20 66 6f 72 20 6c |or color|,1 for l|
|00003990| 75 6d 69 6e 61 6e 63 65 | 2d 6d 61 70 70 65 64 20 |uminance|-mapped |
|000039a0| 67 72 61 79 2e 0d 31 32 | 2f 39 2f 39 32 09 09 64 |gray..12|/9/92..d|
|000039b0| 67 70 09 45 6e 68 61 6e | 63 65 64 20 47 44 52 65 |gp.Enhan|ced GDRe|
|000039c0| 73 74 6f 72 65 44 65 76 | 69 63 65 43 6c 75 74 28 |storeDev|iceClut(|
|000039d0| 29 2e 20 50 61 73 73 69 | 6e 67 20 61 20 4e 55 4c |). Passi|ng a NUL|
|000039e0| 4c 20 61 72 67 75 6d 65 | 6e 74 20 6e 6f 77 20 72 |L argume|nt now r|
|000039f0| 65 71 75 65 73 74 73 0d | 09 09 09 09 61 70 70 6c |equests.|....appl|
|00003a00| 69 63 61 74 69 6f 6e 20 | 74 6f 20 61 6c 6c 20 64 |ication |to all d|
|00003a10| 65 76 69 63 65 73 2e 20 | 49 20 6f 6e 6c 79 20 6a |evices. |I only j|
|00003a20| 75 73 74 20 6c 65 61 72 | 6e 65 64 20 74 68 61 74 |ust lear|ned that|
|00003a30| 20 41 70 70 6c 65 27 73 | 0d 09 09 09 09 52 65 73 | Apple's|.....Res|
|00003a40| 74 6f 72 65 44 65 76 69 | 63 65 43 6c 75 74 28 29 |toreDevi|ceClut()|
|00003a50| 20 62 65 68 61 76 65 73 | 20 69 6e 20 74 68 69 73 | behaves| in this|
|00003a60| 20 77 61 79 2e 0d 31 32 | 2f 31 35 2f 39 32 09 64 | way..12|/15/92.d|
|00003a70| 67 70 20 52 65 6e 61 6d | 65 64 20 47 44 52 65 73 |gp Renam|ed GDRes|
|00003a80| 74 6f 72 65 44 65 76 69 | 63 65 43 6c 75 74 20 74 |toreDevi|ceClut t|
|00003a90| 6f 20 47 44 52 65 73 74 | 6f 72 65 44 65 76 69 63 |o GDRest|oreDevic|
|00003aa0| 65 43 6c 75 74 20 74 6f | 20 62 65 20 63 6f 6e 73 |eClut to| be cons|
|00003ab0| 69 73 74 65 6e 74 0d 09 | 09 09 09 77 69 74 68 20 |istent..|...with |
|00003ac0| 41 70 70 6c 65 27 73 20 | 63 61 70 69 74 61 6c 69 |Apple's |capitali|
|00003ad0| 7a 61 74 69 6f 6e 20 6f | 66 20 52 65 73 74 6f 72 |zation o|f Restor|
|00003ae0| 65 44 65 76 69 63 65 43 | 6c 75 74 2e 0d 31 32 2f |eDeviceC|lut..12/|
|00003af0| 31 36 2f 39 32 09 64 67 | 70 20 55 70 64 61 74 65 |16/92.dg|p Update|
|00003b00| 64 20 63 6f 6d 6d 65 6e | 74 73 20 74 6f 20 62 65 |d commen|ts to be|
|00003b10| 20 63 6f 6e 73 69 73 74 | 65 6e 74 20 77 69 74 68 | consist|ent with|
|00003b20| 20 33 72 64 20 65 64 69 | 74 69 6f 6e 20 6f 66 20 | 3rd edi|tion of |
|00003b30| 44 65 73 69 67 6e 69 6e | 67 20 43 61 72 64 73 0d |Designin|g Cards.|
|00003b40| 09 09 09 09 61 6e 64 20 | 44 72 69 76 65 72 73 2e |....and |Drivers.|
|00003b50| 20 a5 52 65 6e 61 6d 65 | 64 20 6d 79 47 44 48 61 | .Rename|d myGDHa|
|00003b60| 6e 64 6c 65 20 74 6f 20 | 22 64 65 76 69 63 65 22 |ndle to |"device"|
|00003b70| 2c 20 77 68 69 63 68 20 | 69 73 20 65 61 73 69 65 |, which |is easie|
|00003b80| 72 20 74 6f 20 72 65 61 | 64 2e 0d 09 09 09 09 52 |r to rea|d......R|
|00003b90| 65 6e 61 6d 65 64 20 47 | 44 4c 69 6e 65 61 72 47 |enamed G|DLinearG|
|00003ba0| 61 6d 6d 61 20 74 6f 20 | 47 44 55 6e 63 6f 72 72 |amma to |GDUncorr|
|00003bb0| 65 63 74 65 64 47 61 6d | 6d 61 2c 20 61 6e 64 20 |ectedGam|ma, and |
|00003bc0| 67 65 6e 65 72 61 6c 69 | 7a 65 64 20 69 74 0d 09 |generali|zed it..|
|00003bd0| 09 09 09 74 6f 20 77 6f | 72 6b 20 77 69 74 68 20 |...to wo|rk with |
|00003be0| 61 6e 79 20 73 69 7a 65 | 20 44 41 43 2e 20 46 6f |any size| DAC. Fo|
|00003bf0| 72 20 63 6f 6d 70 61 74 | 69 62 69 6c 69 74 79 20 |r compat|ibility |
|00003c00| 77 69 74 68 20 6f 6c 64 | 20 70 72 6f 67 72 61 6d |with old| program|
|00003c10| 73 0d 09 09 09 09 56 69 | 64 65 6f 54 6f 6f 6c 62 |s.....Vi|deoToolb|
|00003c20| 6f 78 2e 68 20 6e 6f 77 | 20 68 61 73 20 61 20 23 |ox.h now| has a #|
|00003c30| 64 65 66 69 6e 65 20 73 | 74 61 74 65 6d 65 6e 74 |define s|tatement|
|00003c40| 20 6d 61 6b 69 6e 67 20 | 47 44 4c 69 6e 65 61 72 | making |GDLinear|
|00003c50| 47 61 6d 6d 61 0d 09 09 | 09 09 61 6e 20 61 6c 69 |Gamma...|..an ali|
|00003c60| 61 73 20 66 6f 72 20 47 | 44 55 6e 63 6f 72 72 65 |as for G|DUncorre|
|00003c70| 63 74 65 64 47 61 6d 6d | 61 2e 0d 31 32 2f 33 30 |ctedGamm|a..12/30|
|00003c80| 2f 39 32 09 64 67 70 20 | 55 70 64 61 74 65 64 20 |/92.dgp |Updated |
|00003c90| 73 6f 6d 65 20 6f 66 20 | 74 68 65 20 63 6f 6d 6d |some of |the comm|
|00003ca0| 65 6e 74 73 2e 20 45 6c | 69 6d 69 6e 61 74 65 64 |ents. El|iminated|
|00003cb0| 20 46 69 6c 65 73 2e 68 | 2e 0d 31 32 2f 33 30 2f | Files.h|..12/30/|
|00003cc0| 39 32 09 64 67 70 20 55 | 73 65 20 47 44 43 6c 75 |92.dgp U|se GDClu|
|00003cd0| 74 53 69 7a 65 28 29 20 | 74 6f 20 64 65 74 65 72 |tSize() |to deter|
|00003ce0| 6d 69 6e 65 20 63 6c 75 | 74 20 73 69 7a 65 2e 0d |mine clu|t size..|
|00003cf0| 31 2f 34 2f 39 33 09 09 | 64 67 70 20 49 6e 20 47 |1/4/93..|dgp In G|
|00003d00| 44 43 6c 75 74 53 69 7a | 65 2c 20 63 68 65 63 6b |DClutSiz|e, check|
|00003d10| 20 66 6f 72 20 66 69 78 | 65 64 54 79 70 65 2e 0d | for fix|edType..|
|00003d20| 31 2f 35 2f 39 33 09 09 | 64 67 70 20 49 6e 20 47 |1/5/93..|dgp In G|
|00003d30| 44 43 6c 75 74 53 69 7a | 65 2c 20 6f 6e 6c 79 20 |DClutSiz|e, only |
|00003d40| 73 65 74 20 6c 61 73 74 | 20 63 6c 75 74 20 65 6e |set last| clut en|
|00003d50| 74 72 79 2e 0d 09 09 09 | 09 41 64 64 65 64 20 50 |try.....|.Added P|
|00003d60| 61 74 63 68 4d 61 63 49 | 49 63 69 56 69 64 65 6f |atchMacI|IciVideo|
|00003d70| 44 72 69 76 65 72 28 29 | 20 74 6f 20 74 68 65 20 |Driver()| to the |
|00003d80| 65 6e 64 20 6f 66 20 74 | 68 69 73 20 66 69 6c 65 |end of t|his file|
|00003d90| 2c 20 61 6e 64 20 0d 09 | 09 09 09 61 75 74 6f 6d |, and ..|...autom|
|00003da0| 61 74 69 63 61 6c 6c 79 | 20 69 6e 76 6f 6b 65 20 |atically| invoke |
|00003db0| 69 74 20 74 68 65 20 66 | 69 72 73 74 20 74 69 6d |it the f|irst tim|
|00003dc0| 65 20 47 44 47 65 74 45 | 6e 74 72 69 65 73 20 69 |e GDGetE|ntries i|
|00003dd0| 73 20 63 61 6c 6c 65 64 | 2e 0d 31 2f 36 2f 39 33 |s called|..1/6/93|
|00003de0| 09 09 64 67 70 09 43 6c | 65 61 6e 65 64 20 75 70 |..dgp.Cl|eaned up|
|00003df0| 20 47 44 43 6c 75 74 53 | 69 7a 65 2e 20 49 74 20 | GDClutS|ize. It |
|00003e00| 6e 6f 77 20 73 65 65 6d | 73 20 74 6f 20 77 6f 72 |now seem|s to wor|
|00003e10| 6b 20 63 6f 72 72 65 63 | 74 6c 79 20 69 6e 20 74 |k correc|tly in t|
|00003e20| 68 65 20 64 69 72 65 63 | 74 20 6d 6f 64 65 73 2e |he direc|t modes.|
|00003e30| 0d 31 2f 31 38 2f 39 33 | 09 64 67 70 09 53 70 72 |.1/18/93|.dgp.Spr|
|00003e40| 75 63 65 64 20 75 70 20 | 74 68 65 20 64 6f 63 75 |uced up |the docu|
|00003e50| 6d 65 6e 74 61 74 69 6f | 6e 2e 0d 09 09 09 a5 41 |mentatio|n......A|
|00003e60| 64 64 65 64 20 61 6c 6c | 20 74 68 65 20 63 6f 64 |dded all| the cod|
|00003e70| 65 20 66 6f 72 6d 65 72 | 6c 79 20 69 6e 20 47 44 |e former|ly in GD|
|00003e80| 49 64 65 6e 74 69 66 79 | 2e 63 2c 20 62 75 74 20 |Identify|.c, but |
|00003e90| 6f 6d 69 74 74 65 64 20 | 74 68 65 20 6f 62 73 6f |omitted |the obso|
|00003ea0| 6c 65 74 65 20 0d 09 09 | 09 66 75 6e 63 74 69 6f |lete ...|.functio|
|00003eb0| 6e 20 47 44 49 64 65 6e | 74 69 66 79 28 29 2c 20 |n GDIden|tify(), |
|00003ec0| 77 68 69 63 68 20 73 69 | 6d 70 6c 79 20 70 72 69 |which si|mply pri|
|00003ed0| 6e 74 65 64 20 47 44 4e | 61 6d 65 28 29 20 61 6e |nted GDN|ame() an|
|00003ee0| 64 20 47 44 56 65 72 73 | 69 6f 6e 2e 0d 09 09 09 |d GDVers|ion.....|
|00003ef0| a5 45 6e 68 61 6e 63 65 | 64 20 47 44 47 65 74 45 |.Enhance|d GDGetE|
|00003f00| 6e 74 72 69 65 73 28 29 | 20 74 6f 20 61 76 6f 69 |ntries()| to avoi|
|00003f10| 64 20 63 61 6c 6c 69 6e | 67 20 64 72 69 76 65 72 |d callin|g driver|
|00003f20| 73 20 74 68 61 74 20 61 | 72 65 20 6b 6e 6f 77 6e |s that a|re known|
|00003f30| 0d 09 09 09 74 6f 20 63 | 72 61 73 68 2c 20 72 65 |....to c|rash, re|
|00003f40| 74 75 72 6e 69 6e 67 20 | 61 20 73 74 61 74 75 73 |turning |a status|
|00003f50| 45 72 72 20 69 6e 73 74 | 65 61 64 2e 0d 09 09 09 |Err inst|ead.....|
|00003f60| a5 52 65 63 6f 64 65 64 | 20 50 61 74 63 68 4d 61 |.Recoded| PatchMa|
|00003f70| 63 49 49 63 69 56 69 64 | 65 6f 44 72 69 76 65 72 |cIIciVid|eoDriver|
|00003f80| 28 29 20 73 6f 20 61 73 | 20 6e 6f 74 20 74 6f 20 |() so as| not to |
|00003f90| 63 61 6c 6c 20 47 65 74 | 53 63 72 65 65 6e 44 65 |call Get|ScreenDe|
|00003fa0| 76 69 63 65 2e 63 2e 0d | 32 2f 31 2f 39 33 09 64 |vice.c..|2/1/93.d|
|00003fb0| 67 70 09 46 69 78 65 64 | 20 65 6e 64 6c 65 73 73 |gp.Fixed| endless|
|00003fc0| 20 6c 6f 6f 70 20 69 6e | 20 50 61 74 63 68 4d 61 | loop in| PatchMa|
|00003fd0| 63 49 49 63 69 56 69 64 | 65 6f 44 72 69 76 65 72 |cIIciVid|eoDriver|
|00003fe0| 2e 20 45 6e 68 61 6e 63 | 65 64 20 74 6f 20 64 65 |. Enhanc|ed to de|
|00003ff0| 61 6c 20 77 69 74 68 0d | 09 09 09 52 4f 4d 2d 62 |al with.|...ROM-b|
|00004000| 61 73 65 64 20 64 72 69 | 76 65 72 73 20 61 73 20 |ased dri|vers as |
|00004010| 77 65 6c 6c 2e 0d 32 2f | 35 2f 39 33 09 64 67 70 |well..2/|5/93.dgp|
|00004020| 09 45 78 70 61 6e 64 65 | 64 20 74 68 65 20 64 6f |.Expande|d the do|
|00004030| 63 75 6d 65 6e 74 61 74 | 69 6f 6e 20 6f 66 20 47 |cumentat|ion of G|
|00004040| 44 53 65 74 45 6e 74 72 | 69 65 73 20 61 62 6f 76 |DSetEntr|ies abov|
|00004050| 65 2c 20 61 6e 64 20 73 | 75 70 70 6c 69 65 64 20 |e, and s|upplied |
|00004060| 73 61 6d 70 6c 65 0d 09 | 09 09 63 6f 64 65 20 73 |sample..|..code s|
|00004070| 68 6f 77 69 6e 67 20 68 | 6f 77 20 74 6f 20 6c 6f |howing h|ow to lo|
|00004080| 61 64 20 74 68 65 20 63 | 6c 75 74 2e 0d 32 2f 37 |ad the c|lut..2/7|
|00004090| 2f 39 33 09 64 67 70 20 | 46 69 78 65 64 20 65 6e |/93.dgp |Fixed en|
|000040a0| 64 6c 65 73 73 20 6c 6f | 6f 70 20 69 6e 20 50 61 |dless lo|op in Pa|
|000040b0| 74 63 68 4d 61 63 49 49 | 63 69 56 69 64 65 6f 44 |tchMacII|ciVideoD|
|000040c0| 72 69 76 65 72 2e 0d 32 | 2f 32 30 2f 39 33 09 64 |river..2|/20/93.d|
|000040d0| 67 70 09 46 69 78 65 64 | 20 62 75 67 20 69 6e 20 |gp.Fixed| bug in |
|000040e0| 47 44 55 6e 63 6f 72 72 | 65 63 74 65 64 47 61 6d |GDUncorr|ectedGam|
|000040f0| 6d 61 28 29 20 74 68 61 | 74 20 77 61 73 20 63 61 |ma() tha|t was ca|
|00004100| 75 73 69 6e 67 20 54 65 | 73 74 43 6c 75 74 73 20 |using Te|stCluts |
|00004110| 74 6f 20 66 61 69 6c 0d | 09 09 09 66 6f 72 20 76 |to fail.|...for v|
|00004120| 69 64 65 6f 20 64 65 76 | 69 63 65 73 20 74 68 61 |ideo dev|ices tha|
|00004130| 74 20 68 61 76 65 20 6e | 6f 6e 73 74 61 6e 64 61 |t have n|onstanda|
|00004140| 72 64 20 67 61 6d 6d 61 | 20 74 61 62 6c 65 73 2e |rd gamma| tables.|
|00004150| 20 0d 33 2f 31 38 2f 39 | 33 09 64 67 70 09 46 69 | .3/18/9|3.dgp.Fi|
|00004160| 78 65 64 20 64 69 76 69 | 64 65 20 62 79 20 7a 65 |xed divi|de by ze|
|00004170| 72 6f 20 65 72 72 6f 72 | 20 69 6e 20 47 44 43 6c |ro error| in GDCl|
|00004180| 75 74 53 69 7a 65 2e 0d | 2a 2f 0d 0d 23 69 6e 63 |utSize..|*/..#inc|
|00004190| 6c 75 64 65 20 22 56 69 | 64 65 6f 54 6f 6f 6c 62 |lude "Vi|deoToolb|
|000041a0| 6f 78 2e 68 22 0d 23 69 | 6e 63 6c 75 64 65 20 3c |ox.h".#i|nclude <|
|000041b0| 61 73 73 65 72 74 2e 68 | 3e 0d 23 69 6e 63 6c 75 |assert.h|>.#inclu|
|000041c0| 64 65 20 3c 45 72 72 6f | 72 73 2e 68 3e 0d 23 69 |de <Erro|rs.h>.#i|
|000041d0| 6e 63 6c 75 64 65 20 3c | 52 4f 4d 44 65 66 73 2e |nclude <|ROMDefs.|
|000041e0| 68 3e 0d 23 64 65 66 69 | 6e 65 20 64 52 41 4d 42 |h>.#defi|ne dRAMB|
|000041f0| 61 73 65 64 20 30 78 30 | 30 34 30 0d 0d 74 79 70 |ased 0x0|040..typ|
|00004200| 65 64 65 66 20 73 74 72 | 75 63 74 20 56 44 46 6c |edef str|uct VDFl|
|00004210| 61 67 52 65 63 20 7b 0d | 09 75 6e 73 69 67 6e 65 |agRec {.|.unsigne|
|00004220| 64 20 63 68 61 72 20 66 | 6c 61 67 3b 0d 09 63 68 |d char f|lag;..ch|
|00004230| 61 72 20 70 61 64 3b 0d | 7d 20 56 44 46 6c 61 67 |ar pad;.|} VDFlag|
|00004240| 52 65 63 3b 0d 0d 74 79 | 70 65 64 65 66 20 73 74 |Rec;..ty|pedef st|
|00004250| 72 75 63 74 20 56 44 44 | 65 66 4d 6f 64 65 52 65 |ruct VDD|efModeRe|
|00004260| 63 7b 0d 09 75 6e 73 69 | 67 6e 65 64 20 63 68 61 |c{..unsi|gned cha|
|00004270| 72 20 73 70 49 44 3b 0d | 09 63 68 61 72 20 70 61 |r spID;.|.char pa|
|00004280| 64 3b 0d 7d 20 56 44 44 | 65 66 4d 6f 64 65 52 65 |d;.} VDD|efModeRe|
|00004290| 63 3b 0d 0d 74 79 70 65 | 64 65 66 20 73 74 72 75 |c;..type|def stru|
|000042a0| 63 74 20 7b 0d 09 73 68 | 6f 72 74 20 66 6c 61 67 |ct {..sh|ort flag|
|000042b0| 73 3b 0d 09 73 68 6f 72 | 74 20 62 6c 61 6e 6b 73 |s;..shor|t blanks|
|000042c0| 5b 33 5d 3b 0d 09 73 68 | 6f 72 74 20 6f 70 65 6e |[3];..sh|ort open|
|000042d0| 3b 0d 09 73 68 6f 72 74 | 20 70 72 69 6d 65 3b 0d |;..short| prime;.|
|000042e0| 09 73 68 6f 72 74 20 63 | 6f 6e 74 72 6f 6c 3b 0d |.short c|ontrol;.|
|000042f0| 09 73 68 6f 72 74 20 73 | 74 61 74 75 73 3b 0d 09 |.short s|tatus;..|
|00004300| 73 68 6f 72 74 20 63 6c | 6f 73 65 3b 0d 09 53 74 |short cl|ose;..St|
|00004310| 72 32 35 35 20 6e 61 6d | 65 3b 0d 7d 20 56 69 64 |r255 nam|e;.} Vid|
|00004320| 65 6f 44 72 69 76 65 72 | 3b 0d 56 69 64 65 6f 44 |eoDriver|;.VideoD|
|00004330| 72 69 76 65 72 20 2a 47 | 44 44 72 69 76 65 72 41 |river *G|DDriverA|
|00004340| 64 64 72 65 73 73 28 47 | 44 48 61 6e 64 6c 65 20 |ddress(G|DHandle |
|00004350| 64 65 76 69 63 65 29 3b | 0d 0d 74 79 70 65 64 65 |device);|..typede|
|00004360| 66 20 73 74 72 75 63 74 | 20 7b 0d 09 73 68 6f 72 |f struct| {..shor|
|00004370| 74 20 63 73 43 6f 64 65 | 3b 09 09 2f 2f 20 63 6f |t csCode|;..// co|
|00004380| 6e 74 72 6f 6c 20 63 6f | 64 65 0d 09 73 68 6f 72 |ntrol co|de..shor|
|00004390| 74 20 6c 65 6e 67 74 68 | 3b 09 09 2f 2f 20 74 6f |t length|;..// to|
|000043a0| 74 61 6c 20 70 61 72 61 | 6d 65 74 65 72 20 62 6c |tal para|meter bl|
|000043b0| 6f 63 6b 20 62 79 74 65 | 73 0d 09 63 68 61 72 20 |ock byte|s..char |
|000043c0| 70 61 72 61 6d 5b 5d 3b | 09 09 2f 2f 20 63 6f 6e |param[];|..// con|
|000043d0| 74 72 6f 6c 20 63 61 6c | 6c 20 64 61 74 61 0d 7d |trol cal|l data.}|
|000043e0| 20 53 63 72 6e 43 74 6c | 3b 0d 0d 74 79 70 65 64 | ScrnCtl|;..typed|
|000043f0| 65 66 20 73 74 72 75 63 | 74 20 7b 0d 09 73 68 6f |ef struc|t {..sho|
|00004400| 72 74 20 73 70 44 72 76 | 72 48 77 3b 09 09 2f 2f |rt spDrv|rHw;..//|
|00004410| 20 53 6c 6f 74 20 4d 61 | 6e 61 67 65 72 20 49 44 | Slot Ma|nager ID|
|00004420| 0d 09 73 68 6f 72 74 20 | 73 6c 6f 74 3b 09 09 09 |..short |slot;...|
|00004430| 2f 2f 20 4e 75 6d 62 65 | 72 20 6f 66 20 73 6c 6f |// Numbe|r of slo|
|00004440| 74 0d 09 6c 6f 6e 67 20 | 64 43 74 6c 44 65 76 42 |t..long |dCtlDevB|
|00004450| 61 73 65 3b 09 2f 2f 20 | 53 74 61 72 74 20 6f 66 |ase;.// |Start of|
|00004460| 20 64 65 76 69 63 65 27 | 73 20 61 64 64 72 65 73 | device'|s addres|
|00004470| 73 20 73 70 61 63 65 0d | 09 73 68 6f 72 74 20 6d |s space.|.short m|
|00004480| 6f 64 65 3b 09 09 09 2f | 2f 20 73 63 72 65 65 6e |ode;.../|/ screen|
|00004490| 20 63 68 61 72 61 63 74 | 65 72 69 73 74 69 63 73 | charact|eristics|
|000044a0| 0d 09 73 68 6f 72 74 20 | 66 6c 61 67 4d 61 73 6b |..short |flagMask|
|000044b0| 3b 09 09 2f 2f 20 57 68 | 69 63 68 20 66 6c 61 67 |;..// Wh|ich flag|
|000044c0| 20 62 69 74 73 20 61 72 | 65 20 75 73 65 64 0d 09 | bits ar|e used..|
|000044d0| 73 68 6f 72 74 20 66 6c | 61 67 73 3b 09 09 2f 2f |short fl|ags;..//|
|000044e0| 20 64 65 76 69 63 65 20 | 73 74 61 74 65 3a 20 62 | device |state: b|
|000044f0| 69 74 20 30 20 3d 20 30 | 20 3d 20 6d 6f 6e 6f 3b |it 0 = 0| = mono;|
|00004500| 20 62 69 74 20 30 20 3d | 20 31 20 3d 20 63 6f 6c | bit 0 =| 1 = col|
|00004510| 6f 72 3b 0d 09 09 09 09 | 09 09 2f 2f 20 62 69 74 |or;.....|..// bit|
|00004520| 20 31 31 20 3d 20 20 31 | 20 3d 20 73 74 61 72 74 | 11 = 1| = start|
|00004530| 75 70 20 64 65 76 69 63 | 65 3b 20 62 69 74 20 31 |up devic|e; bit 1|
|00004540| 35 20 3d 20 31 20 3d 20 | 61 63 74 69 76 65 0d 09 |5 = 1 = |active..|
|00004550| 73 68 6f 72 74 20 63 6f | 6c 6f 72 54 61 62 6c 65 |short co|lorTable|
|00004560| 3b 09 2f 2f 20 27 63 6c | 75 74 27 20 69 64 2c 20 |;.// 'cl|ut' id, |
|00004570| 64 65 66 61 75 6c 74 20 | 3d 20 2d 31 0d 09 73 68 |default |= -1..sh|
|00004580| 6f 72 74 20 67 61 6d 6d | 61 54 61 62 6c 65 3b 09 |ort gamm|aTable;.|
|00004590| 2f 2f 20 53 65 6c 65 63 | 74 73 20 63 6f 6c 6f 72 |// Selec|ts color|
|000045a0| 20 69 6e 74 65 6e 73 69 | 74 79 2c 20 64 65 66 61 | intensi|ty, defa|
|000045b0| 75 6c 74 20 28 4d 61 63 | 49 49 29 20 3d 20 2d 31 |ult (Mac|II) = -1|
|000045c0| 0d 09 52 65 63 74 20 67 | 6c 6f 62 61 6c 52 65 63 |..Rect g|lobalRec|
|000045d0| 74 3b 09 2f 2f 20 67 6c | 6f 62 61 6c 20 72 65 63 |t;.// gl|obal rec|
|000045e0| 74 61 6e 67 6c 65 2c 20 | 6d 61 69 6e 20 64 65 76 |tangle, |main dev|
|000045f0| 69 63 65 20 74 6f 70 4c | 65 66 74 20 3d 20 30 2c |ice topL|eft = 0,|
|00004600| 30 0d 09 73 68 6f 72 74 | 20 63 74 6c 43 6f 75 6e |0..short| ctlCoun|
|00004610| 74 3b 09 09 2f 2f 20 74 | 6f 74 61 6c 20 63 6f 6e |t;..// t|otal con|
|00004620| 74 72 6f 6c 20 63 61 6c | 6c 73 0d 09 53 63 72 6e |trol cal|ls..Scrn|
|00004630| 43 74 6c 20 63 74 6c 3b | 0d 7d 20 53 63 72 6e 3b |Ctl ctl;|.} Scrn;|
|00004640| 0d 0d 74 79 70 65 64 65 | 66 20 73 74 72 75 63 74 |..typede|f struct|
|00004650| 20 7b 0d 09 73 68 6f 72 | 74 20 73 63 72 6e 43 6f | {..shor|t scrnCo|
|00004660| 75 6e 74 3b 09 2f 2f 54 | 6f 74 61 6c 20 64 65 76 |unt;.//T|otal dev|
|00004670| 69 63 65 73 0d 09 53 63 | 72 6e 20 73 63 72 6e 3b |ices..Sc|rn scrn;|
|00004680| 0d 7d 20 53 63 72 6e 73 | 3b 09 09 09 09 2f 2f 20 |.} Scrns|;....// |
|00004690| 27 73 63 72 6e 27 20 72 | 65 73 6f 75 72 63 65 0d |'scrn' r|esource.|
|000046a0| 0d 53 63 72 6e 20 2a 2a | 47 44 47 65 74 53 63 72 |.Scrn **|GDGetScr|
|000046b0| 6e 28 47 44 48 61 6e 64 | 6c 65 20 64 65 76 69 63 |n(GDHand|le devic|
|000046c0| 65 29 3b 0d 0d 4f 53 45 | 72 72 20 47 44 53 65 74 |e);..OSE|rr GDSet|
|000046d0| 50 61 67 65 44 72 61 77 | 6e 28 47 44 48 61 6e 64 |PageDraw|n(GDHand|
|000046e0| 6c 65 20 64 65 76 69 63 | 65 2c 73 68 6f 72 74 20 |le devic|e,short |
|000046f0| 70 61 67 65 29 0d 2f 2f | 20 53 65 6c 65 63 74 20 |page).//| Select |
|00004700| 61 20 70 61 67 65 20 6f | 66 20 76 69 64 65 6f 20 |a page o|f video |
|00004710| 6d 65 6d 6f 72 79 20 74 | 6f 20 64 72 61 77 20 69 |memory t|o draw i|
|00004720| 6e 74 6f 2e 0d 2f 2f 20 | 55 6e 74 65 73 74 65 64 |nto..// |Untested|
|00004730| 2e 0d 7b 0d 09 4f 53 45 | 72 72 20 65 72 72 6f 72 |..{..OSE|rr error|
|00004740| 3b 0d 09 73 68 6f 72 74 | 20 66 6c 61 67 73 3b 0d |;..short| flags;.|
|00004750| 09 50 74 72 20 62 61 73 | 65 41 64 64 72 3b 0d 09 |.Ptr bas|eAddr;..|
|00004760| 73 74 61 74 69 63 20 6c | 6f 6e 67 20 71 44 3d 2d |static l|ong qD=-|
|00004770| 31 3b 0d 0d 09 69 66 28 | 71 44 3d 3d 2d 31 29 47 |1;...if(|qD==-1)G|
|00004780| 65 73 74 61 6c 74 28 67 | 65 73 74 61 6c 74 51 75 |estalt(g|estaltQu|
|00004790| 69 63 6b 64 72 61 77 56 | 65 72 73 69 6f 6e 2c 26 |ickdrawV|ersion,&|
|000047a0| 71 44 29 3b 0d 09 65 72 | 72 6f 72 3d 47 44 47 65 |qD);..er|ror=GDGe|
|000047b0| 74 50 61 67 65 42 61 73 | 65 28 64 65 76 69 63 65 |tPageBas|e(device|
|000047c0| 2c 70 61 67 65 2c 26 62 | 61 73 65 41 64 64 72 29 |,page,&b|aseAddr)|
|000047d0| 3b 0d 09 69 66 28 65 72 | 72 6f 72 29 72 65 74 75 |;..if(er|ror)retu|
|000047e0| 72 6e 20 65 72 72 6f 72 | 3b 0d 09 69 66 28 71 44 |rn error|;..if(qD|
|000047f0| 3e 3d 67 65 73 74 61 6c | 74 33 32 42 69 74 51 44 |>=gestal|t32BitQD|
|00004800| 29 7b 0d 09 09 66 6c 61 | 67 73 3d 47 65 74 50 69 |){...fla|gs=GetPi|
|00004810| 78 65 6c 73 53 74 61 74 | 65 28 28 2a 2a 64 65 76 |xelsStat|e((**dev|
|00004820| 69 63 65 29 2e 67 64 50 | 4d 61 70 29 3b 0d 09 09 |ice).gdP|Map);...|
|00004830| 4c 6f 63 6b 50 69 78 65 | 6c 73 28 28 2a 2a 64 65 |LockPixe|ls((**de|
|00004840| 76 69 63 65 29 2e 67 64 | 50 4d 61 70 29 3b 0d 09 |vice).gd|PMap);..|
|00004850| 7d 0d 09 28 2a 2a 28 2a | 2a 64 65 76 69 63 65 29 |}..(**(*|*device)|
|00004860| 2e 67 64 50 4d 61 70 29 | 2e 62 61 73 65 41 64 64 |.gdPMap)|.baseAdd|
|00004870| 72 3d 62 61 73 65 41 64 | 64 72 3b 0d 09 69 66 28 |r=baseAd|dr;..if(|
|00004880| 71 44 3e 3d 67 65 73 74 | 61 6c 74 33 32 42 69 74 |qD>=gest|alt32Bit|
|00004890| 51 44 29 7b 0d 09 09 47 | 44 65 76 69 63 65 43 68 |QD){...G|DeviceCh|
|000048a0| 61 6e 67 65 64 28 64 65 | 76 69 63 65 29 3b 0d 09 |anged(de|vice);..|
|000048b0| 09 53 65 74 50 69 78 65 | 6c 73 53 74 61 74 65 28 |.SetPixe|lsState(|
|000048c0| 28 2a 2a 64 65 76 69 63 | 65 29 2e 67 64 50 4d 61 |(**devic|e).gdPMa|
|000048d0| 70 2c 66 6c 61 67 73 29 | 3b 0d 09 7d 0d 7d 0d 0d |p,flags)|;..}.}..|
|000048e0| 4f 53 45 72 72 20 47 44 | 53 65 74 50 61 67 65 53 |OSErr GD|SetPageS|
|000048f0| 68 6f 77 6e 28 47 44 48 | 61 6e 64 6c 65 20 64 65 |hown(GDH|andle de|
|00004900| 76 69 63 65 2c 73 68 6f | 72 74 20 70 61 67 65 29 |vice,sho|rt page)|
|00004910| 0d 2f 2f 20 53 65 6c 65 | 63 74 20 61 20 70 61 67 |.// Sele|ct a pag|
|00004920| 65 20 6f 66 20 76 69 64 | 65 6f 20 6d 65 6d 6f 72 |e of vid|eo memor|
|00004930| 79 20 66 6f 72 20 64 69 | 73 70 6c 61 79 2e 0d 2f |y for di|splay../|
|00004940| 2f 20 55 6e 74 65 73 74 | 65 64 2e 0d 7b 0d 09 4f |/ Untest|ed..{..O|
|00004950| 53 45 72 72 20 65 72 72 | 6f 72 3b 0d 09 73 68 6f |SErr err|or;..sho|
|00004960| 72 74 20 6d 6f 64 65 3b | 0d 0d 09 65 72 72 6f 72 |rt mode;|...error|
|00004970| 3d 47 44 47 65 74 4d 6f | 64 65 28 64 65 76 69 63 |=GDGetMo|de(devic|
|00004980| 65 2c 26 6d 6f 64 65 2c | 4e 55 4c 4c 2c 4e 55 4c |e,&mode,|NULL,NUL|
|00004990| 4c 29 3b 0d 09 69 66 28 | 65 72 72 6f 72 29 72 65 |L);..if(|error)re|
|000049a0| 74 75 72 6e 20 65 72 72 | 6f 72 3b 0d 09 72 65 74 |turn err|or;..ret|
|000049b0| 75 72 6e 20 47 44 53 65 | 74 4d 6f 64 65 28 64 65 |urn GDSe|tMode(de|
|000049c0| 76 69 63 65 2c 6d 6f 64 | 65 2c 70 61 67 65 2c 4e |vice,mod|e,page,N|
|000049d0| 55 4c 4c 29 3b 0d 7d 0d | 0d 73 68 6f 72 74 20 47 |ULL);.}.|.short G|
|000049e0| 44 43 6c 75 74 53 69 7a | 65 28 47 44 48 61 6e 64 |DClutSiz|e(GDHand|
|000049f0| 6c 65 20 64 65 76 69 63 | 65 29 0d 2f 2f 20 52 65 |le devic|e).// Re|
|00004a00| 74 75 72 6e 73 20 74 68 | 65 20 6e 75 6d 62 65 72 |turns th|e number|
|00004a10| 20 6f 66 20 65 6e 74 72 | 69 65 73 20 69 6e 20 74 | of entr|ies in t|
|00004a20| 68 65 20 63 6c 75 74 2c | 20 69 6e 20 74 68 65 20 |he clut,| in the |
|00004a30| 63 75 72 72 65 6e 74 20 | 6d 6f 64 65 2e 0d 7b 0d |current |mode..{.|
|00004a40| 09 69 6e 74 20 65 72 72 | 6f 72 3b 0d 09 73 68 6f |.int err|or;..sho|
|00004a50| 72 74 20 6d 6f 64 65 3b | 0d 09 6c 6f 6e 67 20 63 |rt mode;|..long c|
|00004a60| 6c 75 74 53 69 7a 65 2c | 69 3b 0d 09 43 6f 6c 6f |lutSize,|i;..Colo|
|00004a70| 72 53 70 65 63 20 2a 74 | 61 62 6c 65 2c 77 68 69 |rSpec *t|able,whi|
|00004a80| 74 65 3d 7b 32 35 35 2c | 30 78 66 66 66 66 2c 30 |te={255,|0xffff,0|
|00004a90| 78 66 66 66 66 2c 30 78 | 66 66 66 66 7d 2c 62 6c |xffff,0x|ffff},bl|
|00004aa0| 61 63 6b 3d 7b 30 2c 30 | 2c 30 2c 30 7d 3b 0d 09 |ack={0,0|,0,0};..|
|00004ab0| 73 74 61 74 69 63 20 43 | 6f 6c 6f 72 53 70 65 63 |static C|olorSpec|
|00004ac0| 20 6c 69 6e 65 61 72 54 | 61 62 6c 65 5b 32 35 36 | linearT|able[256|
|00004ad0| 5d 3b 0d 0d 09 2f 2f 20 | 4d 65 74 68 6f 64 20 31 |];...// |Method 1|
|00004ae0| 2e 20 49 66 20 74 68 65 | 20 63 75 72 72 65 6e 74 |. If the| current|
|00004af0| 20 6d 6f 64 65 20 69 73 | 20 22 63 6c 75 74 54 79 | mode is| "clutTy|
|00004b00| 70 65 22 20 6f 72 20 22 | 66 69 78 65 64 54 79 70 |pe" or "|fixedTyp|
|00004b10| 65 22 20 77 65 20 63 61 | 6e 20 6a 75 73 74 20 67 |e" we ca|n just g|
|00004b20| 65 74 20 74 68 65 20 0d | 09 2f 2f 20 64 65 76 69 |et the .|.// devi|
|00004b30| 63 65 27 73 20 63 74 53 | 69 7a 65 2c 20 70 72 6f |ce's ctS|ize, pro|
|00004b40| 76 69 64 65 64 20 77 65 | 20 68 61 76 65 6e 27 74 |vided we| haven't|
|00004b50| 20 62 79 70 61 73 73 65 | 64 20 51 75 69 63 6b 44 | bypasse|d QuickD|
|00004b60| 72 61 77 20 74 6f 20 63 | 68 61 6e 67 65 20 0d 09 |raw to c|hange ..|
|00004b70| 2f 2f 20 74 68 65 20 6d | 6f 64 65 2e 0d 09 63 6c |// the m|ode...cl|
|00004b80| 75 74 53 69 7a 65 3d 31 | 2b 28 2a 2a 28 2a 2a 28 |utSize=1|+(**(**(|
|00004b90| 2a 2a 64 65 76 69 63 65 | 29 2e 67 64 50 4d 61 70 |**device|).gdPMap|
|00004ba0| 29 2e 70 6d 54 61 62 6c | 65 29 2e 63 74 53 69 7a |).pmTabl|e).ctSiz|
|00004bb0| 65 3b 0d 09 2f 2f 20 4d | 65 74 68 6f 64 20 32 2e |e;..// M|ethod 2.|
|00004bc0| 20 4a 75 73 74 20 69 6e | 20 63 61 73 65 20 74 68 | Just in| case th|
|00004bd0| 65 20 76 69 64 65 6f 20 | 6d 6f 64 65 20 68 61 73 |e video |mode has|
|00004be0| 20 62 65 65 6e 20 63 68 | 61 6e 67 65 64 0d 09 2f | been ch|anged../|
|00004bf0| 2f 20 62 79 20 63 61 6c | 6c 69 6e 67 20 47 44 53 |/ by cal|ling GDS|
|00004c00| 65 74 4d 6f 64 65 28 29 | 2c 20 77 68 69 63 68 20 |etMode()|, which |
|00004c10| 62 79 70 61 73 73 65 73 | 20 51 75 69 63 6b 44 72 |bypasses| QuickDr|
|00004c20| 61 77 2c 20 77 65 27 6c | 6c 0d 09 2f 2f 20 63 6f |aw, we'l|l..// co|
|00004c30| 6d 70 75 74 65 20 74 68 | 65 20 63 6c 75 74 20 73 |mpute th|e clut s|
|00004c40| 69 7a 65 20 66 72 6f 6d | 20 74 68 65 20 6d 6f 64 |ize from| the mod|
|00004c50| 65 20 74 68 61 74 20 77 | 65 20 67 65 74 20 64 69 |e that w|e get di|
|00004c60| 72 65 63 74 6c 79 20 0d | 09 2f 2f 20 66 72 6f 6d |rectly .|.// from|
|00004c70| 20 74 68 65 20 64 72 69 | 76 65 72 2e 0d 09 65 72 | the dri|ver...er|
|00004c80| 72 6f 72 3d 47 44 47 65 | 74 4d 6f 64 65 28 64 65 |ror=GDGe|tMode(de|
|00004c90| 76 69 63 65 2c 26 6d 6f | 64 65 2c 4e 55 4c 4c 2c |vice,&mo|de,NULL,|
|00004ca0| 4e 55 4c 4c 29 3b 0d 09 | 69 66 28 6d 6f 64 65 3c |NULL);..|if(mode<|
|00004cb0| 73 69 78 74 65 65 6e 42 | 69 74 4d 6f 64 65 29 63 |sixteenB|itMode)c|
|00004cc0| 6c 75 74 53 69 7a 65 3d | 31 3c 3c 28 31 3c 3c 28 |lutSize=|1<<(1<<(|
|00004cd0| 6d 6f 64 65 26 37 29 29 | 3b 09 2f 2f 20 63 6c 75 |mode&7))|;.// clu|
|00004ce0| 74 54 79 70 65 20 6f 72 | 20 66 69 78 65 64 54 79 |tType or| fixedTy|
|00004cf0| 70 65 0d 09 65 6c 73 65 | 20 7b 09 09 09 09 09 09 |pe..else| {......|
|00004d00| 09 09 09 09 09 09 2f 2f | 20 64 69 72 65 63 74 54 |......//| directT|
|00004d10| 79 70 65 0d 09 09 2f 2f | 20 4d 65 74 68 6f 64 20 |ype...//| Method |
|00004d20| 33 2e 20 46 6f 72 20 64 | 69 72 65 63 74 54 79 70 |3. For d|irectTyp|
|00004d30| 65 20 77 65 20 72 65 73 | 6f 72 74 20 74 6f 20 74 |e we res|ort to t|
|00004d40| 72 69 61 6c 20 61 6e 64 | 20 65 72 72 6f 72 2e 0d |rial and| error..|
|00004d50| 09 09 2f 2f 20 54 72 79 | 20 32 36 35 2c 31 32 38 |..// Try| 265,128|
|00004d60| 2c 2e 2e 2e 0d 09 09 66 | 6f 72 28 63 6c 75 74 53 |,......f|or(clutS|
|00004d70| 69 7a 65 3d 32 35 36 3b | 63 6c 75 74 53 69 7a 65 |ize=256;|clutSize|
|00004d80| 3e 31 3b 63 6c 75 74 53 | 69 7a 65 3e 3e 3d 31 29 |>1;clutS|ize>>=1)|
|00004d90| 7b 0d 09 09 09 2f 2f 20 | 50 72 65 70 61 72 65 20 |{....// |Prepare |
|00004da0| 6c 69 6e 65 61 72 54 61 | 62 6c 65 5b 5d 2e 0d 09 |linearTa|ble[]...|
|00004db0| 09 09 74 61 62 6c 65 3d | 6c 69 6e 65 61 72 54 61 |..table=|linearTa|
|00004dc0| 62 6c 65 3b 0d 09 09 09 | 66 6f 72 28 69 3d 30 3b |ble;....|for(i=0;|
|00004dd0| 69 3c 63 6c 75 74 53 69 | 7a 65 3b 69 2b 2b 29 7b |i<clutSi|ze;i++){|
|00004de0| 0d 09 09 09 09 74 61 62 | 6c 65 2d 3e 72 67 62 2e |.....tab|le->rgb.|
|00004df0| 72 65 64 3d 74 61 62 6c | 65 2d 3e 72 67 62 2e 67 |red=tabl|e->rgb.g|
|00004e00| 72 65 65 6e 3d 74 61 62 | 6c 65 2d 3e 72 67 62 2e |reen=tab|le->rgb.|
|00004e10| 62 6c 75 65 3d 28 6c 6f | 6e 67 29 30 78 66 66 66 |blue=(lo|ng)0xfff|
|00004e20| 66 2a 69 2f 28 63 6c 75 | 74 53 69 7a 65 2d 31 29 |f*i/(clu|tSize-1)|
|00004e30| 3b 0d 09 09 09 09 74 61 | 62 6c 65 2b 2b 3b 0d 09 |;.....ta|ble++;..|
|00004e40| 09 09 7d 0d 09 09 09 69 | 66 28 6d 6f 64 65 3c 73 |..}....i|f(mode<s|
|00004e50| 69 78 74 65 65 6e 42 69 | 74 4d 6f 64 65 29 0d 09 |ixteenBi|tMode)..|
|00004e60| 09 09 09 65 72 72 6f 72 | 3d 47 44 53 65 74 45 6e |...error|=GDSetEn|
|00004e70| 74 72 69 65 73 28 64 65 | 76 69 63 65 2c 63 6c 75 |tries(de|vice,clu|
|00004e80| 74 53 69 7a 65 2d 31 2c | 30 2c 26 62 6c 61 63 6b |tSize-1,|0,&black|
|00004e90| 29 3b 0d 09 09 09 65 6c | 73 65 20 65 72 72 6f 72 |);....el|se error|
|00004ea0| 3d 47 44 44 69 72 65 63 | 74 53 65 74 45 6e 74 72 |=GDDirec|tSetEntr|
|00004eb0| 69 65 73 28 64 65 76 69 | 63 65 2c 30 2c 63 6c 75 |ies(devi|ce,0,clu|
|00004ec0| 74 53 69 7a 65 2d 31 2c | 6c 69 6e 65 61 72 54 61 |tSize-1,|linearTa|
|00004ed0| 62 6c 65 29 3b 0d 09 09 | 09 69 66 28 21 65 72 72 |ble);...|.if(!err|
|00004ee0| 6f 72 29 62 72 65 61 6b | 3b 0d 09 09 7d 0d 09 09 |or)break|;...}...|
|00004ef0| 69 66 28 63 6c 75 74 53 | 69 7a 65 3d 3d 31 29 73 |if(clutS|ize==1)s|
|00004f00| 77 69 74 63 68 28 6d 6f | 64 65 29 7b 09 2f 2f 20 |witch(mo|de){.// |
|00004f10| 77 68 65 6e 20 61 6c 6c | 20 65 6c 73 65 20 66 61 |when all| else fa|
|00004f20| 69 6c 73 2c 20 67 75 65 | 73 73 0d 09 09 09 63 61 |ils, gue|ss....ca|
|00004f30| 73 65 20 73 69 78 74 65 | 65 6e 42 69 74 4d 6f 64 |se sixte|enBitMod|
|00004f40| 65 3a 0d 09 09 09 09 63 | 6c 75 74 53 69 7a 65 3d |e:.....c|lutSize=|
|00004f50| 33 32 3b 0d 09 09 09 09 | 62 72 65 61 6b 3b 0d 09 |32;.....|break;..|
|00004f60| 09 09 63 61 73 65 20 74 | 68 69 72 74 79 54 77 6f |..case t|hirtyTwo|
|00004f70| 42 69 74 4d 6f 64 65 3a | 0d 09 09 09 09 63 6c 75 |BitMode:|.....clu|
|00004f80| 74 53 69 7a 65 3d 32 35 | 36 3b 0d 09 09 09 09 62 |tSize=25|6;.....b|
|00004f90| 72 65 61 6b 3b 0d 09 09 | 7d 0d 09 7d 0d 09 72 65 |reak;...|}..}..re|
|00004fa0| 74 75 72 6e 20 63 6c 75 | 74 53 69 7a 65 3b 0d 7d |turn clu|tSize;.}|
|00004fb0| 0d 0d 2f 2a 0d 4e 6f 6d | 69 6e 61 6c 6c 79 20 65 |../*.Nom|inally e|
|00004fc0| 71 75 69 76 61 6c 65 6e | 74 20 74 6f 20 41 70 70 |quivalen|t to App|
|00004fd0| 6c 65 27 73 20 52 65 73 | 74 6f 72 65 44 65 76 69 |le's Res|toreDevi|
|00004fe0| 63 65 43 6c 75 74 28 29 | 2c 20 77 68 69 63 68 20 |ceClut()|, which |
|00004ff0| 69 73 20 6f 6e 6c 79 20 | 61 76 61 69 6c 61 62 6c |is only |availabl|
|00005000| 65 0d 73 69 6e 63 65 20 | 53 79 73 74 65 6d 20 36 |e.since |System 6|
|00005010| 2e 30 35 2e 20 48 6f 77 | 65 76 65 72 2c 20 49 20 |.05. How|ever, I |
|00005020| 66 69 6e 64 20 74 68 61 | 74 20 41 70 70 6c 65 27 |find tha|t Apple'|
|00005030| 73 20 72 6f 75 74 69 6e | 65 20 73 6f 6d 65 74 69 |s routin|e someti|
|00005040| 6d 65 73 20 64 6f 65 73 | 20 6e 6f 74 68 69 6e 67 |mes does| nothing|
|00005050| 2c 0d 77 68 65 72 65 61 | 73 20 74 68 69 73 20 72 |,.wherea|s this r|
|00005060| 6f 75 74 69 6e 65 20 61 | 6c 77 61 79 73 20 77 6f |outine a|lways wo|
|00005070| 72 6b 73 2e 20 50 61 73 | 73 69 6e 67 20 61 20 4e |rks. Pas|sing a N|
|00005080| 55 4c 4c 20 61 72 67 75 | 6d 65 6e 74 20 63 61 75 |ULL argu|ment cau|
|00005090| 73 65 73 20 72 65 73 74 | 6f 72 61 74 69 6f 6e 20 |ses rest|oration |
|000050a0| 6f 66 0d 63 6c 75 74 73 | 20 6f 66 20 61 6c 6c 20 |of.cluts| of all |
|000050b0| 76 69 64 65 6f 20 64 65 | 76 69 63 65 73 2e 0d 2a |video de|vices..*|
|000050c0| 2f 0d 4f 53 45 72 72 20 | 47 44 52 65 73 74 6f 72 |/.OSErr |GDRestor|
|000050d0| 65 44 65 76 69 63 65 43 | 6c 75 74 28 47 44 48 61 |eDeviceC|lut(GDHa|
|000050e0| 6e 64 6c 65 20 64 65 76 | 69 63 65 29 0d 7b 0d 09 |ndle dev|ice).{..|
|000050f0| 4f 53 45 72 72 20 65 72 | 72 6f 72 2c 6c 61 73 74 |OSErr er|ror,last|
|00005100| 45 72 72 6f 72 3b 0d 09 | 73 68 6f 72 74 20 6d 6f |Error;..|short mo|
|00005110| 64 65 3b 0d 09 73 68 6f | 72 74 20 63 6f 75 6e 74 |de;..sho|rt count|
|00005120| 3b 0d 09 6c 6f 6e 67 20 | 69 3b 0d 0d 09 2f 2f 20 |;..long |i;...// |
|00005130| 49 66 20 4e 55 4c 4c 2c | 20 74 68 65 6e 20 72 65 |If NULL,| then re|
|00005140| 63 75 72 73 69 76 65 6c | 79 20 63 61 6c 6c 20 6f |cursivel|y call o|
|00005150| 75 72 73 65 6c 76 65 73 | 20 66 6f 72 20 65 61 63 |urselves| for eac|
|00005160| 68 20 64 65 76 69 63 65 | 2e 0d 09 69 66 28 64 65 |h device|...if(de|
|00005170| 76 69 63 65 3d 3d 4e 55 | 4c 4c 29 7b 0d 09 09 6c |vice==NU|LL){...l|
|00005180| 61 73 74 45 72 72 6f 72 | 3d 30 3b 0d 09 09 64 65 |astError|=0;...de|
|00005190| 76 69 63 65 3d 47 65 74 | 44 65 76 69 63 65 4c 69 |vice=Get|DeviceLi|
|000051a0| 73 74 28 29 3b 0d 09 09 | 77 68 69 6c 65 28 64 65 |st();...|while(de|
|000051b0| 76 69 63 65 21 3d 4e 55 | 4c 4c 29 20 7b 0d 09 09 |vice!=NU|LL) {...|
|000051c0| 09 69 66 28 54 65 73 74 | 44 65 76 69 63 65 41 74 |.if(Test|DeviceAt|
|000051d0| 74 72 69 62 75 74 65 28 | 64 65 76 69 63 65 2c 73 |tribute(|device,s|
|000051e0| 63 72 65 65 6e 44 65 76 | 69 63 65 29 29 0d 09 09 |creenDev|ice))...|
|000051f0| 09 09 65 72 72 6f 72 3d | 47 44 52 65 73 74 6f 72 |..error=|GDRestor|
|00005200| 65 44 65 76 69 63 65 43 | 6c 75 74 28 64 65 76 69 |eDeviceC|lut(devi|
|00005210| 63 65 29 3b 0d 09 09 09 | 69 66 28 65 72 72 6f 72 |ce);....|if(error|
|00005220| 29 6c 61 73 74 45 72 72 | 6f 72 3d 65 72 72 6f 72 |)lastErr|or=error|
|00005230| 3b 0d 09 09 09 64 65 76 | 69 63 65 3d 47 65 74 4e |;....dev|ice=GetN|
|00005240| 65 78 74 44 65 76 69 63 | 65 28 64 65 76 69 63 65 |extDevic|e(device|
|00005250| 29 3b 0d 09 09 7d 0d 09 | 09 72 65 74 75 72 6e 20 |);...}..|.return |
|00005260| 6c 61 73 74 45 72 72 6f | 72 3b 0d 09 7d 0d 09 65 |lastErro|r;..}..e|
|00005270| 72 72 6f 72 3d 47 44 47 | 65 74 4d 6f 64 65 28 64 |rror=GDG|etMode(d|
|00005280| 65 76 69 63 65 2c 26 6d | 6f 64 65 2c 4e 55 4c 4c |evice,&m|ode,NULL|
|00005290| 2c 4e 55 4c 4c 29 3b 0d | 09 69 66 28 65 72 72 6f |,NULL);.|.if(erro|
|000052a0| 72 29 72 65 74 75 72 6e | 20 65 72 72 6f 72 3b 0d |r)return| error;.|
|000052b0| 09 69 66 28 6d 6f 64 65 | 3c 73 69 78 74 65 65 6e |.if(mode|<sixteen|
|000052c0| 42 69 74 4d 6f 64 65 29 | 7b 0d 09 09 63 6f 75 6e |BitMode)|{...coun|
|000052d0| 74 3d 28 2a 2a 28 2a 2a | 28 2a 2a 64 65 76 69 63 |t=(**(**|(**devic|
|000052e0| 65 29 2e 67 64 50 4d 61 | 70 29 2e 70 6d 54 61 62 |e).gdPMa|p).pmTab|
|000052f0| 6c 65 29 2e 63 74 53 69 | 7a 65 3b 0d 09 09 65 72 |le).ctSi|ze;...er|
|00005300| 72 6f 72 3d 47 44 53 65 | 74 45 6e 74 72 69 65 73 |ror=GDSe|tEntries|
|00005310| 28 64 65 76 69 63 65 2c | 30 2c 63 6f 75 6e 74 0d |(device,|0,count.|
|00005320| 09 09 09 2c 28 28 2a 2a | 28 2a 2a 28 2a 2a 64 65 |...,((**|(**(**de|
|00005330| 76 69 63 65 29 2e 67 64 | 50 4d 61 70 29 2e 70 6d |vice).gd|PMap).pm|
|00005340| 54 61 62 6c 65 29 29 2e | 63 74 54 61 62 6c 65 29 |Table)).|ctTable)|
|00005350| 3b 0d 09 7d 20 65 6c 73 | 65 20 65 72 72 6f 72 3d |;..} els|e error=|
|00005360| 47 44 53 65 74 47 61 6d | 6d 61 28 64 65 76 69 63 |GDSetGam|ma(devic|
|00005370| 65 2c 4e 55 4c 4c 29 3b | 0d 09 72 65 74 75 72 6e |e,NULL);|..return|
|00005380| 20 65 72 72 6f 72 3b 0d | 7d 0d 0d 47 61 6d 6d 61 | error;.|}..Gamma|
|00005390| 54 62 6c 20 2a 2a 53 61 | 76 65 64 47 61 6d 6d 61 |Tbl **Sa|vedGamma|
|000053a0| 54 61 62 6c 65 5b 4d 41 | 58 5f 53 43 52 45 45 4e |Table[MA|X_SCREEN|
|000053b0| 53 5d 3d 7b 4e 55 4c 4c | 2c 4e 55 4c 4c 2c 4e 55 |S]={NULL|,NULL,NU|
|000053c0| 4c 4c 2c 4e 55 4c 4c 2c | 4e 55 4c 4c 2c 4e 55 4c |LL,NULL,|NULL,NUL|
|000053d0| 4c 2c 4e 55 4c 4c 2c 4e | 55 4c 4c 7d 3b 0d 0d 4f |L,NULL,N|ULL};..O|
|000053e0| 53 45 72 72 20 47 44 53 | 61 76 65 47 61 6d 6d 61 |SErr GDS|aveGamma|
|000053f0| 28 47 44 48 61 6e 64 6c | 65 20 64 65 76 69 63 65 |(GDHandl|e device|
|00005400| 29 0d 7b 0d 09 47 61 6d | 6d 61 54 62 6c 20 2a 67 |).{..Gam|maTbl *g|
|00005410| 61 6d 6d 61 3b 0d 09 4f | 53 45 72 72 20 65 72 72 |amma;..O|SErr err|
|00005420| 6f 72 3b 0d 09 6c 6f 6e | 67 20 73 69 7a 65 3b 0d |or;..lon|g size;.|
|00005430| 09 69 6e 74 20 69 3b 0d | 0d 09 69 66 28 28 2a 64 |.int i;.|..if((*d|
|00005440| 65 76 69 63 65 29 2d 3e | 67 64 54 79 70 65 3d 3d |evice)->|gdType==|
|00005450| 66 69 78 65 64 54 79 70 | 65 29 72 65 74 75 72 6e |fixedTyp|e)return|
|00005460| 20 30 3b 0d 09 69 3d 47 | 65 74 53 63 72 65 65 6e | 0;..i=G|etScreen|
|00005470| 49 6e 64 65 78 28 64 65 | 76 69 63 65 29 3b 0d 09 |Index(de|vice);..|
|00005480| 69 66 28 69 3e 3d 4d 41 | 58 5f 53 43 52 45 45 4e |if(i>=MA|X_SCREEN|
|00005490| 53 29 72 65 74 75 72 6e | 20 31 3b 0d 20 09 65 72 |S)return| 1;. .er|
|000054a0| 72 6f 72 3d 47 44 47 65 | 74 47 61 6d 6d 61 28 64 |ror=GDGe|tGamma(d|
|000054b0| 65 76 69 63 65 2c 26 67 | 61 6d 6d 61 29 3b 0d 09 |evice,&g|amma);..|
|000054c0| 69 66 28 65 72 72 6f 72 | 29 72 65 74 75 72 6e 20 |if(error|)return |
|000054d0| 65 72 72 6f 72 3b 0d 09 | 73 69 7a 65 3d 67 61 6d |error;..|size=gam|
|000054e0| 6d 61 2d 3e 67 43 68 61 | 6e 43 6e 74 2a 67 61 6d |ma->gCha|nCnt*gam|
|000054f0| 6d 61 2d 3e 67 44 61 74 | 61 43 6e 74 3b 0d 09 69 |ma->gDat|aCnt;..i|
|00005500| 66 28 67 61 6d 6d 61 2d | 3e 67 44 61 74 61 57 69 |f(gamma-|>gDataWi|
|00005510| 64 74 68 3e 38 29 73 69 | 7a 65 2a 3d 32 3b 0d 09 |dth>8)si|ze*=2;..|
|00005520| 73 69 7a 65 2b 3d 73 69 | 7a 65 6f 66 28 47 61 6d |size+=si|zeof(Gam|
|00005530| 6d 61 54 62 6c 29 2b 67 | 61 6d 6d 61 2d 3e 67 46 |maTbl)+g|amma->gF|
|00005540| 6f 72 6d 75 6c 61 53 69 | 7a 65 3b 0d 09 69 66 28 |ormulaSi|ze;..if(|
|00005550| 53 61 76 65 64 47 61 6d | 6d 61 54 61 62 6c 65 5b |SavedGam|maTable[|
|00005560| 69 5d 21 3d 4e 55 4c 4c | 29 7b 0d 09 09 44 69 73 |i]!=NULL|){...Dis|
|00005570| 70 6f 73 65 48 61 6e 64 | 6c 65 28 28 48 61 6e 64 |poseHand|le((Hand|
|00005580| 6c 65 29 53 61 76 65 64 | 47 61 6d 6d 61 54 61 62 |le)Saved|GammaTab|
|00005590| 6c 65 5b 69 5d 29 3b 0d | 09 09 53 61 76 65 64 47 |le[i]);.|..SavedG|
|000055a0| 61 6d 6d 61 54 61 62 6c | 65 5b 69 5d 3d 4e 55 4c |ammaTabl|e[i]=NUL|
|000055b0| 4c 3b 0d 09 7d 0d 09 65 | 72 72 6f 72 3d 50 74 72 |L;..}..e|rror=Ptr|
|000055c0| 54 6f 48 61 6e 64 28 67 | 61 6d 6d 61 2c 28 48 61 |ToHand(g|amma,(Ha|
|000055d0| 6e 64 6c 65 20 2a 29 26 | 53 61 76 65 64 47 61 6d |ndle *)&|SavedGam|
|000055e0| 6d 61 54 61 62 6c 65 5b | 69 5d 2c 73 69 7a 65 29 |maTable[|i],size)|
|000055f0| 3b 0d 09 72 65 74 75 72 | 6e 20 65 72 72 6f 72 3b |;..retur|n error;|
|00005600| 0d 7d 0d 0d 4f 53 45 72 | 72 20 47 44 52 65 73 74 |.}..OSEr|r GDRest|
|00005610| 6f 72 65 47 61 6d 6d 61 | 28 47 44 48 61 6e 64 6c |oreGamma|(GDHandl|
|00005620| 65 20 64 65 76 69 63 65 | 29 0d 7b 0d 09 69 6e 74 |e device|).{..int|
|00005630| 20 69 3b 0d 09 4f 53 45 | 72 72 20 65 72 72 6f 72 | i;..OSE|rr error|
|00005640| 3b 0d 09 0d 09 69 66 28 | 28 2a 64 65 76 69 63 65 |;....if(|(*device|
|00005650| 29 2d 3e 67 64 54 79 70 | 65 3d 3d 66 69 78 65 64 |)->gdTyp|e==fixed|
|00005660| 54 79 70 65 29 72 65 74 | 75 72 6e 20 30 3b 0d 09 |Type)ret|urn 0;..|
|00005670| 69 3d 47 65 74 53 63 72 | 65 65 6e 49 6e 64 65 78 |i=GetScr|eenIndex|
|00005680| 28 64 65 76 69 63 65 29 | 3b 0d 09 69 66 28 69 3e |(device)|;..if(i>|
|00005690| 3d 4d 41 58 5f 53 43 52 | 45 45 4e 53 20 7c 7c 20 |=MAX_SCR|EENS || |
|000056a0| 53 61 76 65 64 47 61 6d | 6d 61 54 61 62 6c 65 5b |SavedGam|maTable[|
|000056b0| 69 5d 3d 3d 4e 55 4c 4c | 29 72 65 74 75 72 6e 20 |i]==NULL|)return |
|000056c0| 31 3b 0d 09 65 72 72 6f | 72 3d 47 44 53 65 74 47 |1;..erro|r=GDSetG|
|000056d0| 61 6d 6d 61 28 64 65 76 | 69 63 65 2c 2a 53 61 76 |amma(dev|ice,*Sav|
|000056e0| 65 64 47 61 6d 6d 61 54 | 61 62 6c 65 5b 69 5d 29 |edGammaT|able[i])|
|000056f0| 3b 0d 09 69 66 28 65 72 | 72 6f 72 29 72 65 74 75 |;..if(er|ror)retu|
|00005700| 72 6e 20 65 72 72 6f 72 | 3b 0d 09 44 69 73 70 6f |rn error|;..Dispo|
|00005710| 73 65 48 61 6e 64 6c 65 | 28 28 48 61 6e 64 6c 65 |seHandle|((Handle|
|00005720| 29 53 61 76 65 64 47 61 | 6d 6d 61 54 61 62 6c 65 |)SavedGa|mmaTable|
|00005730| 5b 69 5d 29 3b 0d 09 53 | 61 76 65 64 47 61 6d 6d |[i]);..S|avedGamm|
|00005740| 61 54 61 62 6c 65 5b 69 | 5d 3d 4e 55 4c 4c 3b 0d |aTable[i|]=NULL;.|
|00005750| 09 72 65 74 75 72 6e 20 | 30 3b 0d 7d 09 0d 0d 4f |.return |0;.}...O|
|00005760| 53 45 72 72 20 47 44 47 | 65 74 44 65 66 61 75 6c |SErr GDG|etDefaul|
|00005770| 74 47 61 6d 6d 61 28 47 | 44 48 61 6e 64 6c 65 20 |tGamma(G|DHandle |
|00005780| 64 65 76 69 63 65 2c 47 | 61 6d 6d 61 54 62 6c 20 |device,G|ammaTbl |
|00005790| 2a 2a 67 61 6d 6d 61 54 | 62 6c 29 0d 2f 2f 20 4c |**gammaT|bl).// L|
|000057a0| 6f 6f 6b 73 20 66 6f 72 | 20 61 20 64 65 66 61 75 |ooks for| a defau|
|000057b0| 6c 74 20 67 61 6d 6d 61 | 20 74 61 62 6c 65 20 69 |lt gamma| table i|
|000057c0| 6e 20 62 6f 74 68 20 70 | 6c 61 63 65 73 20 74 68 |n both p|laces th|
|000057d0| 61 74 20 41 70 70 6c 65 | 20 73 61 79 73 20 74 6f |at Apple| says to|
|000057e0| 20 6c 6f 6f 6b 2c 0d 2f | 2f 20 62 75 74 20 75 73 | look,./|/ but us|
|000057f0| 75 61 6c 6c 79 20 63 6f | 6d 65 73 20 75 70 20 65 |ually co|mes up e|
|00005800| 6d 70 74 79 20 68 61 6e | 64 65 64 2e 0d 7b 0d 09 |mpty han|ded..{..|
|00005810| 4f 53 45 72 72 20 65 72 | 72 6f 72 3b 0d 09 69 6e |OSErr er|ror;..in|
|00005820| 74 20 69 2c 6a 2c 73 6c | 6f 74 3b 0d 09 53 63 72 |t i,j,sl|ot;..Scr|
|00005830| 6e 20 2a 2a 73 63 72 6e | 3b 0d 09 47 61 6d 6d 61 |n **scrn|;..Gamma|
|00005840| 54 62 6c 20 2a 2a 67 61 | 6d 6d 61 48 61 6e 64 6c |Tbl **ga|mmaHandl|
|00005850| 65 2c 2a 67 61 6d 6d 61 | 3b 0d 09 53 70 42 6c 6f |e,*gamma|;..SpBlo|
|00005860| 63 6b 20 73 70 42 6c 6f | 63 6b 3b 0d 09 50 74 72 |ck spBlo|ck;..Ptr|
|00005870| 20 70 74 72 3b 0d 0d 09 | 67 61 6d 6d 61 48 61 6e | ptr;...|gammaHan|
|00005880| 64 6c 65 3d 4e 55 4c 4c | 3b 0d 09 69 66 28 43 6f |dle=NULL|;..if(Co|
|00005890| 75 6e 74 52 65 73 6f 75 | 72 63 65 73 28 27 67 61 |untResou|rces('ga|
|000058a0| 6d 61 27 29 3e 30 29 7b | 2f 2f 20 41 6e 79 20 27 |ma')>0){|// Any '|
|000058b0| 67 61 6d 61 27 20 72 65 | 73 6f 75 72 63 65 73 20 |gama' re|sources |
|000058c0| 61 76 61 69 6c 61 62 6c | 65 20 69 6e 20 53 79 73 |availabl|e in Sys|
|000058d0| 74 65 6d 20 66 69 6c 65 | 3f 0d 09 09 2f 2f 20 43 |tem file|?...// C|
|000058e0| 68 65 63 6b 20 74 6f 20 | 73 65 65 20 69 66 20 27 |heck to |see if '|
|000058f0| 73 63 72 6e 27 20 72 65 | 73 6f 75 72 63 65 20 69 |scrn' re|source i|
|00005900| 6e 20 53 79 73 74 65 6d | 20 66 69 6c 65 20 73 70 |n System| file sp|
|00005910| 65 63 69 66 69 65 73 20 | 61 20 27 67 61 6d 61 27 |ecifies |a 'gama'|
|00005920| 20 72 65 73 6f 75 72 63 | 65 2e 0d 09 09 73 63 72 | resourc|e....scr|
|00005930| 6e 3d 47 44 47 65 74 53 | 63 72 6e 28 64 65 76 69 |n=GDGetS|crn(devi|
|00005940| 63 65 29 3b 0d 09 09 69 | 66 28 73 63 72 6e 21 3d |ce);...i|f(scrn!=|
|00005950| 4e 55 4c 4c 20 26 26 20 | 28 2a 2a 73 63 72 6e 29 |NULL && |(**scrn)|
|00005960| 2e 67 61 6d 6d 61 54 61 | 62 6c 65 21 3d 2d 31 29 |.gammaTa|ble!=-1)|
|00005970| 0d 09 09 09 67 61 6d 6d | 61 48 61 6e 64 6c 65 3d |....gamm|aHandle=|
|00005980| 28 47 61 6d 6d 61 54 62 | 6c 20 2a 2a 29 47 65 74 |(GammaTb|l **)Get|
|00005990| 52 65 73 6f 75 72 63 65 | 28 27 67 61 6d 61 27 2c |Resource|('gama',|
|000059a0| 28 2a 2a 73 63 72 6e 29 | 2e 67 61 6d 6d 61 54 61 |(**scrn)|.gammaTa|
|000059b0| 62 6c 65 29 3b 0d 09 09 | 44 69 73 70 6f 73 65 48 |ble);...|DisposeH|
|000059c0| 61 6e 64 6c 65 28 28 48 | 61 6e 64 6c 65 29 73 63 |andle((H|andle)sc|
|000059d0| 72 6e 29 3b 0d 09 7d 0d | 09 69 66 28 67 61 6d 6d |rn);..}.|.if(gamm|
|000059e0| 61 48 61 6e 64 6c 65 21 | 3d 4e 55 4c 4c 29 7b 0d |aHandle!|=NULL){.|
|000059f0| 09 09 2f 2f 20 47 6f 74 | 20 67 61 6d 6d 61 20 74 |..// Got| gamma t|
|00005a00| 61 62 6c 65 20 66 72 6f | 6d 20 27 67 61 6d 61 27 |able fro|m 'gama'|
|00005a10| 20 72 65 73 6f 75 72 63 | 65 2e 0d 09 09 67 61 6d | resourc|e....gam|
|00005a20| 6d 61 3d 28 47 61 6d 6d | 61 54 62 6c 20 2a 29 4e |ma=(Gamm|aTbl *)N|
|00005a30| 65 77 50 74 72 28 47 65 | 74 48 61 6e 64 6c 65 53 |ewPtr(Ge|tHandleS|
|00005a40| 69 7a 65 28 28 48 61 6e | 64 6c 65 29 67 61 6d 6d |ize((Han|dle)gamm|
|00005a50| 61 48 61 6e 64 6c 65 29 | 29 3b 0d 09 09 69 66 28 |aHandle)|);...if(|
|00005a60| 67 61 6d 6d 61 3d 3d 4e | 55 4c 4c 29 72 65 74 75 |gamma==N|ULL)retu|
|00005a70| 72 6e 20 4d 65 6d 45 72 | 72 6f 72 28 29 3b 0d 09 |rn MemEr|ror();..|
|00005a80| 09 42 6c 6f 63 6b 4d 6f | 76 65 28 2a 67 61 6d 6d |.BlockMo|ve(*gamm|
|00005a90| 61 48 61 6e 64 6c 65 2c | 67 61 6d 6d 61 2c 47 65 |aHandle,|gamma,Ge|
|00005aa0| 74 48 61 6e 64 6c 65 53 | 69 7a 65 28 28 48 61 6e |tHandleS|ize((Han|
|00005ab0| 64 6c 65 29 67 61 6d 6d | 61 48 61 6e 64 6c 65 29 |dle)gamm|aHandle)|
|00005ac0| 29 3b 0d 09 09 44 69 73 | 70 6f 73 65 48 61 6e 64 |);...Dis|poseHand|
|00005ad0| 6c 65 28 28 48 61 6e 64 | 6c 65 29 67 61 6d 6d 61 |le((Hand|le)gamma|
|00005ae0| 48 61 6e 64 6c 65 29 3b | 0d 09 7d 65 6c 73 65 7b |Handle);|..}else{|
|00005af0| 0d 09 09 2f 2f 20 54 72 | 79 20 74 6f 20 67 65 74 |...// Tr|y to get|
|00005b00| 20 74 68 69 73 20 64 65 | 76 69 63 65 27 73 20 64 | this de|vice's d|
|00005b10| 65 66 61 75 6c 74 20 67 | 61 6d 6d 61 20 74 61 62 |efault g|amma tab|
|00005b20| 6c 65 20 66 72 6f 6d 20 | 53 6c 6f 74 20 4d 61 6e |le from |Slot Man|
|00005b30| 61 67 65 72 2e 0d 09 09 | 73 70 42 6c 6f 63 6b 2e |ager....|spBlock.|
|00005b40| 73 70 53 6c 6f 74 3d 73 | 6c 6f 74 3d 47 65 74 44 |spSlot=s|lot=GetD|
|00005b50| 65 76 69 63 65 53 6c 6f | 74 28 64 65 76 69 63 65 |eviceSlo|t(device|
|00005b60| 29 3b 0d 09 09 73 70 42 | 6c 6f 63 6b 2e 73 70 49 |);...spB|lock.spI|
|00005b70| 44 3d 30 3b 0d 09 09 73 | 70 42 6c 6f 63 6b 2e 73 |D=0;...s|pBlock.s|
|00005b80| 70 45 78 74 44 65 76 3d | 30 3b 0d 09 09 73 70 42 |pExtDev=|0;...spB|
|00005b90| 6c 6f 63 6b 2e 73 70 54 | 42 4d 61 73 6b 3d 33 3b |lock.spT|BMask=3;|
|00005ba0| 09 09 09 2f 2f 20 6d 61 | 74 63 68 20 6f 6e 6c 79 |...// ma|tch only|
|00005bb0| 20 73 70 43 61 74 65 67 | 6f 72 79 20 61 6e 64 20 | spCateg|ory and |
|00005bc0| 73 70 43 54 79 70 65 0d | 09 09 73 70 42 6c 6f 63 |spCType.|..spBloc|
|00005bd0| 6b 2e 73 70 43 61 74 65 | 67 6f 72 79 3d 63 61 74 |k.spCate|gory=cat|
|00005be0| 44 69 73 70 6c 61 79 3b | 0d 09 09 73 70 42 6c 6f |Display;|...spBlo|
|00005bf0| 63 6b 2e 73 70 43 54 79 | 70 65 3d 74 79 70 65 56 |ck.spCTy|pe=typeV|
|00005c00| 69 64 65 6f 3b 09 2f 2f | 20 74 68 69 73 20 6d 69 |ideo;.//| this mi|
|00005c10| 67 68 74 20 62 65 20 74 | 6f 6f 20 72 65 73 74 72 |ght be t|oo restr|
|00005c20| 69 63 74 69 76 65 2c 20 | 65 78 63 6c 75 64 65 73 |ictive, |excludes|
|00005c30| 20 4c 43 44 0d 09 09 64 | 6f 7b 0d 09 09 09 65 72 | LCD...d|o{....er|
|00005c40| 72 6f 72 3d 53 4e 65 78 | 74 54 79 70 65 53 52 73 |ror=SNex|tTypeSRs|
|00005c50| 72 63 28 26 73 70 42 6c | 6f 63 6b 29 3b 0d 09 09 |rc(&spBl|ock);...|
|00005c60| 09 69 66 28 65 72 72 6f | 72 29 72 65 74 75 72 6e |.if(erro|r)return|
|00005c70| 20 65 72 72 6f 72 3b 0d | 09 09 7d 77 68 69 6c 65 | error;.|..}while|
|00005c80| 28 73 70 42 6c 6f 63 6b | 2e 73 70 53 6c 6f 74 21 |(spBlock|.spSlot!|
|00005c90| 3d 73 6c 6f 74 20 7c 7c | 20 73 70 42 6c 6f 63 6b |=slot ||| spBlock|
|00005ca0| 2e 73 70 52 65 66 4e 75 | 6d 21 3d 28 2a 2a 64 65 |.spRefNu|m!=(**de|
|00005cb0| 76 69 63 65 29 2e 67 64 | 52 65 66 4e 75 6d 29 3b |vice).gd|RefNum);|
|00005cc0| 0d 09 09 0d 09 09 69 66 | 28 30 29 7b 0d 09 09 09 |......if|(0){....|
|00005cd0| 2f 2f 20 50 72 69 6e 74 | 20 73 52 65 73 6f 75 72 |// Print| sResour|
|00005ce0| 63 65 20 6e 61 6d 65 0d | 09 09 09 73 70 42 6c 6f |ce name.|...spBlo|
|00005cf0| 63 6b 2e 73 70 49 44 3d | 73 52 73 72 63 4e 61 6d |ck.spID=|sRsrcNam|
|00005d00| 65 3b 0d 09 09 09 65 72 | 72 6f 72 3d 53 47 65 74 |e;....er|ror=SGet|
|00005d10| 43 53 74 72 69 6e 67 28 | 26 73 70 42 6c 6f 63 6b |CString(|&spBlock|
|00005d20| 29 3b 0d 09 09 09 70 72 | 69 6e 74 66 28 22 53 6c |);....pr|intf("Sl|
|00005d30| 6f 74 20 72 65 73 6f 75 | 72 63 65 20 d2 25 73 d3 |ot resou|rce .%s.|
|00005d40| 5c 6e 22 2c 73 70 42 6c | 6f 63 6b 2e 73 70 52 65 |\n",spBl|ock.spRe|
|00005d50| 73 75 6c 74 29 3b 0d 09 | 09 09 69 66 28 65 72 72 |sult);..|..if(err|
|00005d60| 6f 72 29 72 65 74 75 72 | 6e 20 65 72 72 6f 72 3b |or)retur|n error;|
|00005d70| 0d 09 09 09 44 69 73 70 | 6f 73 65 50 74 72 28 28 |....Disp|osePtr((|
|00005d80| 50 74 72 29 73 70 42 6c | 6f 63 6b 2e 73 70 52 65 |Ptr)spBl|ock.spRe|
|00005d90| 73 75 6c 74 29 3b 0d 09 | 09 7d 0d 09 09 0d 09 09 |sult);..|.}......|
|00005da0| 2f 2f 20 4c 6f 6f 6b 20 | 66 6f 72 20 67 61 6d 6d |// Look |for gamm|
|00005db0| 61 20 64 69 72 65 63 74 | 6f 72 79 2e 20 55 6e 66 |a direct|ory. Unf|
|00005dc0| 6f 72 74 75 6e 61 74 65 | 6c 79 20 6d 61 6e 79 20 |ortunate|ly many |
|00005dd0| 76 69 64 65 6f 20 64 65 | 76 69 63 65 73 20 64 6f |video de|vices do|
|00005de0| 6e 27 74 20 68 61 76 65 | 20 6f 6e 65 2e 0d 09 09 |n't have| one....|
|00005df0| 73 70 42 6c 6f 63 6b 2e | 73 70 49 44 3d 73 47 61 |spBlock.|spID=sGa|
|00005e00| 6d 6d 61 44 69 72 3b 0d | 09 09 65 72 72 6f 72 3d |mmaDir;.|..error=|
|00005e10| 53 46 69 6e 64 53 74 72 | 75 63 74 28 26 73 70 42 |SFindStr|uct(&spB|
|00005e20| 6c 6f 63 6b 29 3b 0d 09 | 09 69 66 28 65 72 72 6f |lock);..|.if(erro|
|00005e30| 72 29 72 65 74 75 72 6e | 20 65 72 72 6f 72 3b 0d |r)return| error;.|
|00005e40| 09 09 0d 09 09 2f 2f 20 | 52 65 74 72 69 65 76 65 |.....// |Retrieve|
|00005e50| 20 64 65 66 61 75 6c 74 | 20 67 61 6d 6d 61 20 74 | default| gamma t|
|00005e60| 61 62 6c 65 0d 09 09 73 | 70 42 6c 6f 63 6b 2e 73 |able...s|pBlock.s|
|00005e70| 70 49 44 3d 30 78 38 30 | 3b 0d 09 09 65 72 72 6f |pID=0x80|;...erro|
|00005e80| 72 3d 53 47 65 74 42 6c | 6f 63 6b 28 26 73 70 42 |r=SGetBl|ock(&spB|
|00005e90| 6c 6f 63 6b 29 3b 0d 09 | 09 69 66 28 65 72 72 6f |lock);..|.if(erro|
|00005ea0| 72 29 72 65 74 75 72 6e | 20 65 72 72 6f 72 3b 0d |r)return| error;.|
|00005eb0| 09 09 67 61 6d 6d 61 3d | 28 47 61 6d 6d 61 54 62 |..gamma=|(GammaTb|
|00005ec0| 6c 20 2a 29 73 70 42 6c | 6f 63 6b 2e 73 70 52 65 |l *)spBl|ock.spRe|
|00005ed0| 73 75 6c 74 3b 0d 09 09 | 70 74 72 3d 28 50 74 72 |sult;...|ptr=(Ptr|
|00005ee0| 29 73 70 42 6c 6f 63 6b | 2e 73 70 52 65 73 75 6c |)spBlock|.spResul|
|00005ef0| 74 2b 36 3b 0d 09 09 69 | 66 28 30 29 70 72 69 6e |t+6;...i|f(0)prin|
|00005f00| 74 66 28 22 47 61 6d 6d | 61 20 74 61 62 6c 65 20 |tf("Gamm|a table |
|00005f10| d2 25 73 d3 2c 20 25 6c | 64 20 62 79 74 65 73 5c |.%s., %l|d bytes\|
|00005f20| 6e 22 2c 70 74 72 2c 47 | 65 74 50 74 72 53 69 7a |n",ptr,G|etPtrSiz|
|00005f30| 65 28 28 50 74 72 29 67 | 61 6d 6d 61 29 29 3b 0d |e((Ptr)g|amma));.|
|00005f40| 09 09 70 74 72 2b 3d 73 | 74 72 6c 65 6e 28 70 74 |..ptr+=s|trlen(pt|
|00005f50| 72 29 2b 31 3b 09 09 09 | 09 2f 2f 20 74 61 62 6c |r)+1;...|.// tabl|
|00005f60| 65 20 69 73 20 6a 75 73 | 74 20 70 61 73 74 20 73 |e is jus|t past s|
|00005f70| 74 72 69 6e 67 0d 09 09 | 70 74 72 3d 28 50 74 72 |tring...|ptr=(Ptr|
|00005f80| 29 28 28 6c 6f 6e 67 29 | 28 70 74 72 2b 31 29 26 |)((long)|(ptr+1)&|
|00005f90| 7e 31 4c 29 3b 09 2f 2f | 20 72 6f 75 6e 64 20 75 |~1L);.//| round u|
|00005fa0| 70 20 74 6f 20 65 76 65 | 6e 20 61 64 64 72 65 73 |p to eve|n addres|
|00005fb0| 73 0d 09 09 69 3d 70 74 | 72 2d 28 50 74 72 29 67 |s...i=pt|r-(Ptr)g|
|00005fc0| 61 6d 6d 61 3b 0d 09 09 | 42 6c 6f 63 6b 4d 6f 76 |amma;...|BlockMov|
|00005fd0| 65 28 70 74 72 2c 28 50 | 74 72 29 67 61 6d 6d 61 |e(ptr,(P|tr)gamma|
|00005fe0| 2c 47 65 74 50 74 72 53 | 69 7a 65 28 28 50 74 72 |,GetPtrS|ize((Ptr|
|00005ff0| 29 67 61 6d 6d 61 29 2d | 69 29 3b 0d 09 09 53 65 |)gamma)-|i);...Se|
|00006000| 74 50 74 72 53 69 7a 65 | 28 28 50 74 72 29 67 61 |tPtrSize|((Ptr)ga|
|00006010| 6d 6d 61 2c 47 65 74 50 | 74 72 53 69 7a 65 28 28 |mma,GetP|trSize((|
|00006020| 50 74 72 29 67 61 6d 6d | 61 29 2d 69 29 3b 0d 09 |Ptr)gamm|a)-i);..|
|00006030| 7d 0d 09 2a 67 61 6d 6d | 61 54 62 6c 3d 67 61 6d |}..*gamm|aTbl=gam|
|00006040| 6d 61 3b 0d 09 72 65 74 | 75 72 6e 20 30 3b 0d 7d |ma;..ret|urn 0;.}|
|00006050| 0d 0d 53 63 72 6e 20 2a | 2a 47 44 47 65 74 53 63 |..Scrn *|*GDGetSc|
|00006060| 72 6e 28 47 44 48 61 6e | 64 6c 65 20 64 65 76 69 |rn(GDHan|dle devi|
|00006070| 63 65 29 0d 2f 2f 20 52 | 65 74 75 72 6e 73 20 68 |ce).// R|eturns h|
|00006080| 61 6e 64 6c 65 20 74 6f | 20 61 20 63 6f 70 79 20 |andle to| a copy |
|00006090| 6f 66 20 74 68 65 20 73 | 70 65 63 69 66 69 63 20 |of the s|pecific |
|000060a0| 73 63 72 6e 20 72 65 73 | 6f 75 72 63 65 20 66 6f |scrn res|ource fo|
|000060b0| 72 20 74 68 69 73 20 64 | 65 76 69 63 65 2c 0d 2f |r this d|evice,./|
|000060c0| 2f 20 6f 72 20 4e 55 4c | 4c 20 69 66 20 6e 6f 6e |/ or NUL|L if non|
|000060d0| 65 2e 0d 7b 0d 09 4f 53 | 45 72 72 20 65 72 72 6f |e..{..OS|Err erro|
|000060e0| 72 3d 30 3b 0d 09 69 6e | 74 20 69 2c 6a 3b 0d 09 |r=0;..in|t i,j;..|
|000060f0| 53 63 72 6e 73 20 2a 2a | 73 63 72 6e 73 3b 0d 09 |Scrns **|scrns;..|
|00006100| 53 63 72 6e 20 2a 73 63 | 72 6e 2c 2a 2a 73 63 72 |Scrn *sc|rn,**scr|
|00006110| 6e 48 61 6e 64 6c 65 3b | 0d 09 53 63 72 6e 43 74 |nHandle;|..ScrnCt|
|00006120| 6c 20 2a 63 74 6c 3b 0d | 09 69 6e 74 20 73 63 72 |l *ctl;.|.int scr|
|00006130| 6e 43 6f 75 6e 74 3b 0d | 09 6c 6f 6e 67 20 73 69 |nCount;.|.long si|
|00006140| 7a 65 3b 0d 09 73 68 6f | 72 74 20 6d 6f 64 65 3b |ze;..sho|rt mode;|
|00006150| 0d 0d 09 73 63 72 6e 73 | 3d 28 53 63 72 6e 73 20 |...scrns|=(Scrns |
|00006160| 2a 2a 29 47 65 74 52 65 | 73 6f 75 72 63 65 28 27 |**)GetRe|source('|
|00006170| 73 63 72 6e 27 2c 30 29 | 3b 0d 09 69 66 28 52 65 |scrn',0)|;..if(Re|
|00006180| 73 45 72 72 6f 72 28 29 | 29 72 65 74 75 72 6e 20 |sError()|)return |
|00006190| 4e 55 4c 4c 3b 0d 09 48 | 4c 6f 63 6b 48 69 28 28 |NULL;..H|LockHi((|
|000061a0| 48 61 6e 64 6c 65 29 73 | 63 72 6e 73 29 3b 0d 09 |Handle)s|crns);..|
|000061b0| 73 63 72 6e 43 6f 75 6e | 74 3d 28 2a 2a 73 63 72 |scrnCoun|t=(**scr|
|000061c0| 6e 73 29 2e 73 63 72 6e | 43 6f 75 6e 74 3b 0d 09 |ns).scrn|Count;..|
|000061d0| 73 63 72 6e 3d 26 28 2a | 2a 73 63 72 6e 73 29 2e |scrn=&(*|*scrns).|
|000061e0| 73 63 72 6e 3b 0d 09 66 | 6f 72 28 69 3d 30 3b 69 |scrn;..f|or(i=0;i|
|000061f0| 3c 73 63 72 6e 43 6f 75 | 6e 74 3b 69 2b 2b 29 7b |<scrnCou|nt;i++){|
|00006200| 0d 09 09 69 66 28 30 20 | 26 26 20 73 63 72 6e 2d |...if(0 |&& scrn-|
|00006210| 3e 73 6c 6f 74 3d 3d 47 | 65 74 44 65 76 69 63 65 |>slot==G|etDevice|
|00006220| 53 6c 6f 74 28 64 65 76 | 69 63 65 29 29 7b 0d 09 |Slot(dev|ice)){..|
|00006230| 09 09 70 72 69 6e 74 66 | 28 22 53 6c 6f 74 20 25 |..printf|("Slot %|
|00006240| 64 2c 22 2c 73 63 72 6e | 2d 3e 73 6c 6f 74 29 3b |d,",scrn|->slot);|
|00006250| 0d 09 09 09 70 72 69 6e | 74 66 28 22 6d 6f 64 65 |....prin|tf("mode|
|00006260| 20 25 64 2c 22 2c 73 63 | 72 6e 2d 3e 6d 6f 64 65 | %d,",sc|rn->mode|
|00006270| 29 3b 0d 09 09 09 70 72 | 69 6e 74 66 28 22 63 6f |);....pr|intf("co|
|00006280| 6c 6f 72 54 61 62 6c 65 | 20 25 64 2c 22 2c 73 63 |lorTable| %d,",sc|
|00006290| 72 6e 2d 3e 63 6f 6c 6f | 72 54 61 62 6c 65 29 3b |rn->colo|rTable);|
|000062a0| 0d 09 09 09 70 72 69 6e | 74 66 28 22 67 61 6d 6d |....prin|tf("gamm|
|000062b0| 61 54 61 62 6c 65 20 25 | 64 2c 22 2c 73 63 72 6e |aTable %|d,",scrn|
|000062c0| 2d 3e 67 61 6d 6d 61 54 | 61 62 6c 65 29 3b 0d 09 |->gammaT|able);..|
|000062d0| 09 09 70 72 69 6e 74 66 | 28 22 25 64 20 63 6f 6e |..printf|("%d con|
|000062e0| 74 72 6f 6c 20 63 61 6c | 6c 73 3a 22 2c 73 63 72 |trol cal|ls:",scr|
|000062f0| 6e 2d 3e 63 74 6c 43 6f | 75 6e 74 29 3b 0d 09 09 |n->ctlCo|unt);...|
|00006300| 7d 0d 09 09 63 74 6c 3d | 26 73 63 72 6e 2d 3e 63 |}...ctl=|&scrn->c|
|00006310| 74 6c 3b 0d 09 09 66 6f | 72 28 6a 3d 30 3b 6a 3c |tl;...fo|r(j=0;j<|
|00006320| 73 63 72 6e 2d 3e 63 74 | 6c 43 6f 75 6e 74 3b 6a |scrn->ct|lCount;j|
|00006330| 2b 2b 29 7b 0d 09 09 09 | 69 66 28 30 20 26 26 20 |++){....|if(0 && |
|00006340| 73 63 72 6e 2d 3e 73 6c | 6f 74 3d 3d 47 65 74 44 |scrn->sl|ot==GetD|
|00006350| 65 76 69 63 65 53 6c 6f | 74 28 64 65 76 69 63 65 |eviceSlo|t(device|
|00006360| 29 29 70 72 69 6e 74 66 | 28 22 20 25 64 22 2c 63 |))printf|(" %d",c|
|00006370| 74 6c 2d 3e 63 73 43 6f | 64 65 29 3b 0d 09 09 09 |tl->csCo|de);....|
|00006380| 63 74 6c 3d 28 53 63 72 | 6e 43 74 6c 20 2a 29 28 |ctl=(Scr|nCtl *)(|
|00006390| 28 6c 6f 6e 67 29 28 63 | 74 6c 2b 31 29 2b 63 74 |(long)(c|tl+1)+ct|
|000063a0| 6c 2d 3e 6c 65 6e 67 74 | 68 29 3b 0d 09 09 7d 0d |l->lengt|h);...}.|
|000063b0| 09 09 69 66 28 30 20 26 | 26 20 73 63 72 6e 2d 3e |..if(0 &|& scrn->|
|000063c0| 73 6c 6f 74 3d 3d 47 65 | 74 44 65 76 69 63 65 53 |slot==Ge|tDeviceS|
|000063d0| 6c 6f 74 28 64 65 76 69 | 63 65 29 29 70 72 69 6e |lot(devi|ce))prin|
|000063e0| 74 66 28 22 5c 6e 22 29 | 3b 0d 09 09 73 69 7a 65 |tf("\n")|;...size|
|000063f0| 3d 28 6c 6f 6e 67 29 63 | 74 6c 2d 28 6c 6f 6e 67 |=(long)c|tl-(long|
+--------+-------------------------+-------------------------+--------+--------+
Only 25.0 KB of data is shown above.